Skip to content
This repository has been archived by the owner on May 5, 2023. It is now read-only.

[AutoPR containerregistry/resource-manager] allow specifying credentials for source registry on import image #3744

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -57,6 +64,14 @@ class ImportSource {
name: 'String'
}
},
credentials: {
required: false,
serializedName: 'credentials',
type: {
name: 'Composite',
className: 'ImportSourceCredentials'
}
},
sourceImage: {
required: true,
serializedName: 'sourceImage',
Expand Down
Original file line number Diff line number Diff line change
@@ -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;
33 changes: 31 additions & 2 deletions lib/services/containerRegistryManagement/lib/models/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -33,6 +54,7 @@ export { CloudError } from 'ms-rest-azure';
export interface ImportSource {
resourceId?: string;
registryUri?: string;
credentials?: ImportSourceCredentials;
sourceImage: string;
}

Expand All @@ -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.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ class SourceTrigger {
name: 'Sequence',
element: {
required: false,
serializedName: 'StringElementType',
serializedName: 'SourceTriggerEventElementType',
type: {
name: 'String'
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ class SourceTriggerUpdateParameters {
name: 'Sequence',
element: {
required: false,
serializedName: 'StringElementType',
serializedName: 'SourceTriggerEventElementType',
type: {
name: 'String'
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ class Webhook extends models['Resource'] {
name: 'Sequence',
element: {
required: false,
serializedName: 'StringElementType',
serializedName: 'WebhookActionElementType',
type: {
name: 'String'
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ class WebhookCreateParameters {
name: 'Sequence',
element: {
required: false,
serializedName: 'StringElementType',
serializedName: 'WebhookActionElementType',
type: {
name: 'String'
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ class WebhookUpdateParameters {
name: 'Sequence',
element: {
required: false,
serializedName: 'StringElementType',
serializedName: 'WebhookActionElementType',
type: {
name: 'String'
}
Expand Down
44 changes: 40 additions & 4 deletions lib/services/containerRegistryManagement/lib/operations/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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.
Expand Down Expand Up @@ -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.
Expand Down Expand Up @@ -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.
Expand Down
Loading