From 96fbfd73ebdc868d9cc8ca857d25e61577e793b0 Mon Sep 17 00:00:00 2001 From: Azure SDK for Python bot Date: Mon, 1 Oct 2018 22:01:54 +0000 Subject: [PATCH 1/2] Generated from 7d58dd0e73fb2740d7ebe8e534a973e959395d68 allow specifying credentials for source registry on import image --- .../lib/models/importImageParameters.js | 9 ++- .../lib/models/importSource.js | 17 ++++- .../lib/models/importSourceCredentials.js | 61 +++++++++++++++++ .../lib/models/index.d.ts | 33 +++++++++- .../lib/models/index.js | 1 + .../lib/operations/index.d.ts | 44 +++++++++++-- .../lib/operations/registries.js | 66 +++++++++++++++++-- 7 files changed, 217 insertions(+), 14 deletions(-) create mode 100644 lib/services/containerRegistryManagement/lib/models/importSourceCredentials.js diff --git a/lib/services/containerRegistryManagement/lib/models/importImageParameters.js b/lib/services/containerRegistryManagement/lib/models/importImageParameters.js index 27027a3978..47526cfb7e 100644 --- a/lib/services/containerRegistryManagement/lib/models/importImageParameters.js +++ b/lib/services/containerRegistryManagement/lib/models/importImageParameters.js @@ -19,7 +19,14 @@ class ImportImageParameters { * @member {object} source The source of the image. * @member {string} [source.resourceId] The resource identifier of the source * Azure Container Registry. - * @member {string} [source.registryUri] The address of the source registry. + * @member {string} [source.registryUri] The address of the source registry + * (e.g. 'mcr.microsoft.com'). + * @member {object} [source.credentials] Credentials used when importing from + * a registry uri. + * @member {string} [source.credentials.username] The username to + * authenticate with the source registry. + * @member {string} [source.credentials.password] The password used to + * authenticate with the source registry. * @member {string} [source.sourceImage] Repository name of the source image. * Specify an image by repository ('hello-world'). This will use the 'latest' * tag. diff --git a/lib/services/containerRegistryManagement/lib/models/importSource.js b/lib/services/containerRegistryManagement/lib/models/importSource.js index 171a3d18d4..12dfd4899c 100644 --- a/lib/services/containerRegistryManagement/lib/models/importSource.js +++ b/lib/services/containerRegistryManagement/lib/models/importSource.js @@ -18,7 +18,14 @@ class ImportSource { * Create a ImportSource. * @member {string} [resourceId] The resource identifier of the source Azure * Container Registry. - * @member {string} [registryUri] The address of the source registry. + * @member {string} [registryUri] The address of the source registry (e.g. + * 'mcr.microsoft.com'). + * @member {object} [credentials] Credentials used when importing from a + * registry uri. + * @member {string} [credentials.username] The username to authenticate with + * the source registry. + * @member {string} [credentials.password] The password used to authenticate + * with the source registry. * @member {string} sourceImage Repository name of the source image. * Specify an image by repository ('hello-world'). This will use the 'latest' * tag. @@ -57,6 +64,14 @@ class ImportSource { name: 'String' } }, + credentials: { + required: false, + serializedName: 'credentials', + type: { + name: 'Composite', + className: 'ImportSourceCredentials' + } + }, sourceImage: { required: true, serializedName: 'sourceImage', diff --git a/lib/services/containerRegistryManagement/lib/models/importSourceCredentials.js b/lib/services/containerRegistryManagement/lib/models/importSourceCredentials.js new file mode 100644 index 0000000000..1645b2d3f8 --- /dev/null +++ b/lib/services/containerRegistryManagement/lib/models/importSourceCredentials.js @@ -0,0 +1,61 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * Class representing a ImportSourceCredentials. + */ +class ImportSourceCredentials { + /** + * Create a ImportSourceCredentials. + * @member {string} [username] The username to authenticate with the source + * registry. + * @member {string} password The password used to authenticate with the + * source registry. + */ + constructor() { + } + + /** + * Defines the metadata of ImportSourceCredentials + * + * @returns {object} metadata of ImportSourceCredentials + * + */ + mapper() { + return { + required: false, + serializedName: 'ImportSourceCredentials', + type: { + name: 'Composite', + className: 'ImportSourceCredentials', + modelProperties: { + username: { + required: false, + serializedName: 'username', + type: { + name: 'String' + } + }, + password: { + required: true, + serializedName: 'password', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = ImportSourceCredentials; diff --git a/lib/services/containerRegistryManagement/lib/models/index.d.ts b/lib/services/containerRegistryManagement/lib/models/index.d.ts index 09e9c4c2e5..d274710765 100644 --- a/lib/services/containerRegistryManagement/lib/models/index.d.ts +++ b/lib/services/containerRegistryManagement/lib/models/index.d.ts @@ -16,13 +16,34 @@ export { BaseResource } from 'ms-rest-azure'; export { CloudError } from 'ms-rest-azure'; +/** + * @class + * Initializes a new instance of the ImportSourceCredentials class. + * @constructor + * @member {string} [username] The username to authenticate with the source + * registry. + * @member {string} password The password used to authenticate with the source + * registry. + */ +export interface ImportSourceCredentials { + username?: string; + password: string; +} + /** * @class * Initializes a new instance of the ImportSource class. * @constructor * @member {string} [resourceId] The resource identifier of the source Azure * Container Registry. - * @member {string} [registryUri] The address of the source registry. + * @member {string} [registryUri] The address of the source registry (e.g. + * 'mcr.microsoft.com'). + * @member {object} [credentials] Credentials used when importing from a + * registry uri. + * @member {string} [credentials.username] The username to authenticate with + * the source registry. + * @member {string} [credentials.password] The password used to authenticate + * with the source registry. * @member {string} sourceImage Repository name of the source image. * Specify an image by repository ('hello-world'). This will use the 'latest' * tag. @@ -33,6 +54,7 @@ export { CloudError } from 'ms-rest-azure'; export interface ImportSource { resourceId?: string; registryUri?: string; + credentials?: ImportSourceCredentials; sourceImage: string; } @@ -43,7 +65,14 @@ export interface ImportSource { * @member {object} source The source of the image. * @member {string} [source.resourceId] The resource identifier of the source * Azure Container Registry. - * @member {string} [source.registryUri] The address of the source registry. + * @member {string} [source.registryUri] The address of the source registry + * (e.g. 'mcr.microsoft.com'). + * @member {object} [source.credentials] Credentials used when importing from a + * registry uri. + * @member {string} [source.credentials.username] The username to authenticate + * with the source registry. + * @member {string} [source.credentials.password] The password used to + * authenticate with the source registry. * @member {string} [source.sourceImage] Repository name of the source image. * Specify an image by repository ('hello-world'). This will use the 'latest' * tag. diff --git a/lib/services/containerRegistryManagement/lib/models/index.js b/lib/services/containerRegistryManagement/lib/models/index.js index 251e5a95fe..5b0f4c8e2b 100644 --- a/lib/services/containerRegistryManagement/lib/models/index.js +++ b/lib/services/containerRegistryManagement/lib/models/index.js @@ -18,6 +18,7 @@ var msRestAzure = require('ms-rest-azure'); exports.BaseResource = msRestAzure.BaseResource; exports.CloudError = msRestAzure.CloudError; +exports.ImportSourceCredentials = require('./importSourceCredentials'); exports.ImportSource = require('./importSource'); exports.ImportImageParameters = require('./importImageParameters'); exports.RegistryNameCheckRequest = require('./registryNameCheckRequest'); diff --git a/lib/services/containerRegistryManagement/lib/operations/index.d.ts b/lib/services/containerRegistryManagement/lib/operations/index.d.ts index 69d68aea12..0ae02c168a 100644 --- a/lib/services/containerRegistryManagement/lib/operations/index.d.ts +++ b/lib/services/containerRegistryManagement/lib/operations/index.d.ts @@ -39,7 +39,16 @@ export interface Registries { * the source Azure Container Registry. * * @param {string} [parameters.source.registryUri] The address of the source - * registry. + * registry (e.g. 'mcr.microsoft.com'). + * + * @param {object} [parameters.source.credentials] Credentials used when + * importing from a registry uri. + * + * @param {string} [parameters.source.credentials.username] The username to + * authenticate with the source registry. + * + * @param {string} parameters.source.credentials.password The password used to + * authenticate with the source registry. * * @param {string} parameters.source.sourceImage Repository name of the source * image. @@ -92,7 +101,16 @@ export interface Registries { * the source Azure Container Registry. * * @param {string} [parameters.source.registryUri] The address of the source - * registry. + * registry (e.g. 'mcr.microsoft.com'). + * + * @param {object} [parameters.source.credentials] Credentials used when + * importing from a registry uri. + * + * @param {string} [parameters.source.credentials.username] The username to + * authenticate with the source registry. + * + * @param {string} parameters.source.credentials.password The password used to + * authenticate with the source registry. * * @param {string} parameters.source.sourceImage Repository name of the source * image. @@ -1176,7 +1194,16 @@ export interface Registries { * the source Azure Container Registry. * * @param {string} [parameters.source.registryUri] The address of the source - * registry. + * registry (e.g. 'mcr.microsoft.com'). + * + * @param {object} [parameters.source.credentials] Credentials used when + * importing from a registry uri. + * + * @param {string} [parameters.source.credentials.username] The username to + * authenticate with the source registry. + * + * @param {string} parameters.source.credentials.password The password used to + * authenticate with the source registry. * * @param {string} parameters.source.sourceImage Repository name of the source * image. @@ -1229,7 +1256,16 @@ export interface Registries { * the source Azure Container Registry. * * @param {string} [parameters.source.registryUri] The address of the source - * registry. + * registry (e.g. 'mcr.microsoft.com'). + * + * @param {object} [parameters.source.credentials] Credentials used when + * importing from a registry uri. + * + * @param {string} [parameters.source.credentials.username] The username to + * authenticate with the source registry. + * + * @param {string} parameters.source.credentials.password The password used to + * authenticate with the source registry. * * @param {string} parameters.source.sourceImage Repository name of the source * image. diff --git a/lib/services/containerRegistryManagement/lib/operations/registries.js b/lib/services/containerRegistryManagement/lib/operations/registries.js index 68be1d6574..1bf3f83810 100644 --- a/lib/services/containerRegistryManagement/lib/operations/registries.js +++ b/lib/services/containerRegistryManagement/lib/operations/registries.js @@ -33,7 +33,16 @@ const WebResource = msRest.WebResource; * the source Azure Container Registry. * * @param {string} [parameters.source.registryUri] The address of the source - * registry. + * registry (e.g. 'mcr.microsoft.com'). + * + * @param {object} [parameters.source.credentials] Credentials used when + * importing from a registry uri. + * + * @param {string} [parameters.source.credentials.username] The username to + * authenticate with the source registry. + * + * @param {string} parameters.source.credentials.password The password used to + * authenticate with the source registry. * * @param {string} parameters.source.sourceImage Repository name of the source * image. @@ -1988,7 +1997,16 @@ function _getBuildSourceUploadUrl(resourceGroupName, registryName, options, call * the source Azure Container Registry. * * @param {string} [parameters.source.registryUri] The address of the source - * registry. + * registry (e.g. 'mcr.microsoft.com'). + * + * @param {object} [parameters.source.credentials] Credentials used when + * importing from a registry uri. + * + * @param {string} [parameters.source.credentials.username] The username to + * authenticate with the source registry. + * + * @param {string} parameters.source.credentials.password The password used to + * authenticate with the source registry. * * @param {string} parameters.source.sourceImage Repository name of the source * image. @@ -3412,7 +3430,16 @@ class Registries { * the source Azure Container Registry. * * @param {string} [parameters.source.registryUri] The address of the source - * registry. + * registry (e.g. 'mcr.microsoft.com'). + * + * @param {object} [parameters.source.credentials] Credentials used when + * importing from a registry uri. + * + * @param {string} [parameters.source.credentials.username] The username to + * authenticate with the source registry. + * + * @param {string} parameters.source.credentials.password The password used to + * authenticate with the source registry. * * @param {string} parameters.source.sourceImage Repository name of the source * image. @@ -3477,7 +3504,16 @@ class Registries { * the source Azure Container Registry. * * @param {string} [parameters.source.registryUri] The address of the source - * registry. + * registry (e.g. 'mcr.microsoft.com'). + * + * @param {object} [parameters.source.credentials] Credentials used when + * importing from a registry uri. + * + * @param {string} [parameters.source.credentials.username] The username to + * authenticate with the source registry. + * + * @param {string} parameters.source.credentials.password The password used to + * authenticate with the source registry. * * @param {string} parameters.source.sourceImage Repository name of the source * image. @@ -4954,7 +4990,16 @@ class Registries { * the source Azure Container Registry. * * @param {string} [parameters.source.registryUri] The address of the source - * registry. + * registry (e.g. 'mcr.microsoft.com'). + * + * @param {object} [parameters.source.credentials] Credentials used when + * importing from a registry uri. + * + * @param {string} [parameters.source.credentials.username] The username to + * authenticate with the source registry. + * + * @param {string} parameters.source.credentials.password The password used to + * authenticate with the source registry. * * @param {string} parameters.source.sourceImage Repository name of the source * image. @@ -5019,7 +5064,16 @@ class Registries { * the source Azure Container Registry. * * @param {string} [parameters.source.registryUri] The address of the source - * registry. + * registry (e.g. 'mcr.microsoft.com'). + * + * @param {object} [parameters.source.credentials] Credentials used when + * importing from a registry uri. + * + * @param {string} [parameters.source.credentials.username] The username to + * authenticate with the source registry. + * + * @param {string} parameters.source.credentials.password The password used to + * authenticate with the source registry. * * @param {string} parameters.source.sourceImage Repository name of the source * image. From 78f74fd888395528652eee2f64122f65a9211464 Mon Sep 17 00:00:00 2001 From: Azure SDK for Python bot Date: Mon, 8 Oct 2018 21:40:30 +0000 Subject: [PATCH 2/2] Generated from 7d58dd0e73fb2740d7ebe8e534a973e959395d68 allow specifying credentials for source registry on import image --- .../containerRegistryManagement/lib/models/sourceTrigger.js | 2 +- .../lib/models/sourceTriggerUpdateParameters.js | 2 +- lib/services/containerRegistryManagement/lib/models/webhook.js | 2 +- .../lib/models/webhookCreateParameters.js | 2 +- .../lib/models/webhookUpdateParameters.js | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/services/containerRegistryManagement/lib/models/sourceTrigger.js b/lib/services/containerRegistryManagement/lib/models/sourceTrigger.js index e9e8983901..1c7f8c9d0f 100644 --- a/lib/services/containerRegistryManagement/lib/models/sourceTrigger.js +++ b/lib/services/containerRegistryManagement/lib/models/sourceTrigger.js @@ -79,7 +79,7 @@ class SourceTrigger { name: 'Sequence', element: { required: false, - serializedName: 'StringElementType', + serializedName: 'SourceTriggerEventElementType', type: { name: 'String' } diff --git a/lib/services/containerRegistryManagement/lib/models/sourceTriggerUpdateParameters.js b/lib/services/containerRegistryManagement/lib/models/sourceTriggerUpdateParameters.js index c21d7a0bd4..b7bb10a97c 100644 --- a/lib/services/containerRegistryManagement/lib/models/sourceTriggerUpdateParameters.js +++ b/lib/services/containerRegistryManagement/lib/models/sourceTriggerUpdateParameters.js @@ -79,7 +79,7 @@ class SourceTriggerUpdateParameters { name: 'Sequence', element: { required: false, - serializedName: 'StringElementType', + serializedName: 'SourceTriggerEventElementType', type: { name: 'String' } diff --git a/lib/services/containerRegistryManagement/lib/models/webhook.js b/lib/services/containerRegistryManagement/lib/models/webhook.js index a4081efafd..c1b8c0801f 100644 --- a/lib/services/containerRegistryManagement/lib/models/webhook.js +++ b/lib/services/containerRegistryManagement/lib/models/webhook.js @@ -116,7 +116,7 @@ class Webhook extends models['Resource'] { name: 'Sequence', element: { required: false, - serializedName: 'StringElementType', + serializedName: 'WebhookActionElementType', type: { name: 'String' } diff --git a/lib/services/containerRegistryManagement/lib/models/webhookCreateParameters.js b/lib/services/containerRegistryManagement/lib/models/webhookCreateParameters.js index 4fff23fe37..3e161be847 100644 --- a/lib/services/containerRegistryManagement/lib/models/webhookCreateParameters.js +++ b/lib/services/containerRegistryManagement/lib/models/webhookCreateParameters.js @@ -113,7 +113,7 @@ class WebhookCreateParameters { name: 'Sequence', element: { required: false, - serializedName: 'StringElementType', + serializedName: 'WebhookActionElementType', type: { name: 'String' } diff --git a/lib/services/containerRegistryManagement/lib/models/webhookUpdateParameters.js b/lib/services/containerRegistryManagement/lib/models/webhookUpdateParameters.js index c1fe7547dc..577ae2a0b0 100644 --- a/lib/services/containerRegistryManagement/lib/models/webhookUpdateParameters.js +++ b/lib/services/containerRegistryManagement/lib/models/webhookUpdateParameters.js @@ -104,7 +104,7 @@ class WebhookUpdateParameters { name: 'Sequence', element: { required: false, - serializedName: 'StringElementType', + serializedName: 'WebhookActionElementType', type: { name: 'String' }