Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

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 @@ -10,6 +10,7 @@
# --------------------------------------------------------------------------

try:
from .import_source_credentials_py3 import ImportSourceCredentials
from .import_source_py3 import ImportSource
from .import_image_parameters_py3 import ImportImageParameters
from .registry_name_check_request_py3 import RegistryNameCheckRequest
Expand Down Expand Up @@ -48,6 +49,7 @@
from .event_py3 import Event
from .resource_py3 import Resource
except (SyntaxError, ImportError):
from .import_source_credentials import ImportSourceCredentials
from .import_source import ImportSource
from .import_image_parameters import ImportImageParameters
from .registry_name_check_request import RegistryNameCheckRequest
Expand Down Expand Up @@ -104,6 +106,7 @@
)

__all__ = [
'ImportSourceCredentials',
'ImportSource',
'ImportImageParameters',
'RegistryNameCheckRequest',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,12 @@ class ImportSource(Model):
:param resource_id: The resource identifier of the source Azure Container
Registry.
:type resource_id: str
:param registry_uri: The address of the source registry.
:param registry_uri: The address of the source registry (e.g.
'mcr.microsoft.com').
:type registry_uri: str
:param credentials: Credentials used when importing from a registry uri.
:type credentials:
~azure.mgmt.containerregistry.v2017_10_01.models.ImportSourceCredentials
:param source_image: Required. Repository name of the source image.
Specify an image by repository ('hello-world'). This will use the 'latest'
tag.
Expand All @@ -38,11 +42,13 @@ class ImportSource(Model):
_attribute_map = {
'resource_id': {'key': 'resourceId', 'type': 'str'},
'registry_uri': {'key': 'registryUri', 'type': 'str'},
'credentials': {'key': 'credentials', 'type': 'ImportSourceCredentials'},
'source_image': {'key': 'sourceImage', 'type': 'str'},
}

def __init__(self, **kwargs):
super(ImportSource, self).__init__(**kwargs)
self.resource_id = kwargs.get('resource_id', None)
self.registry_uri = kwargs.get('registry_uri', None)
self.credentials = kwargs.get('credentials', None)
self.source_image = kwargs.get('source_image', None)
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# coding=utf-8
# --------------------------------------------------------------------------
# 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.
# --------------------------------------------------------------------------

from msrest.serialization import Model


class ImportSourceCredentials(Model):
"""ImportSourceCredentials.

All required parameters must be populated in order to send to Azure.

:param username: The username to authenticate with the source registry.
:type username: str
:param password: Required. The password used to authenticate with the
source registry.
:type password: str
"""

_validation = {
'password': {'required': True},
}

_attribute_map = {
'username': {'key': 'username', 'type': 'str'},
'password': {'key': 'password', 'type': 'str'},
}

def __init__(self, **kwargs):
super(ImportSourceCredentials, self).__init__(**kwargs)
self.username = kwargs.get('username', None)
self.password = kwargs.get('password', None)
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# coding=utf-8
# --------------------------------------------------------------------------
# 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.
# --------------------------------------------------------------------------

from msrest.serialization import Model


class ImportSourceCredentials(Model):
"""ImportSourceCredentials.

All required parameters must be populated in order to send to Azure.

:param username: The username to authenticate with the source registry.
:type username: str
:param password: Required. The password used to authenticate with the
source registry.
:type password: str
"""

_validation = {
'password': {'required': True},
}

_attribute_map = {
'username': {'key': 'username', 'type': 'str'},
'password': {'key': 'password', 'type': 'str'},
}

def __init__(self, *, password: str, username: str=None, **kwargs) -> None:
super(ImportSourceCredentials, self).__init__(**kwargs)
self.username = username
self.password = password
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,12 @@ class ImportSource(Model):
:param resource_id: The resource identifier of the source Azure Container
Registry.
:type resource_id: str
:param registry_uri: The address of the source registry.
:param registry_uri: The address of the source registry (e.g.
'mcr.microsoft.com').
:type registry_uri: str
:param credentials: Credentials used when importing from a registry uri.
:type credentials:
~azure.mgmt.containerregistry.v2017_10_01.models.ImportSourceCredentials
:param source_image: Required. Repository name of the source image.
Specify an image by repository ('hello-world'). This will use the 'latest'
tag.
Expand All @@ -38,11 +42,13 @@ class ImportSource(Model):
_attribute_map = {
'resource_id': {'key': 'resourceId', 'type': 'str'},
'registry_uri': {'key': 'registryUri', 'type': 'str'},
'credentials': {'key': 'credentials', 'type': 'ImportSourceCredentials'},
'source_image': {'key': 'sourceImage', 'type': 'str'},
}

def __init__(self, *, source_image: str, resource_id: str=None, registry_uri: str=None, **kwargs) -> None:
def __init__(self, *, source_image: str, resource_id: str=None, registry_uri: str=None, credentials=None, **kwargs) -> None:
super(ImportSource, self).__init__(**kwargs)
self.resource_id = resource_id
self.registry_uri = registry_uri
self.credentials = credentials
self.source_image = source_image
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
# --------------------------------------------------------------------------

try:
from .import_source_credentials_py3 import ImportSourceCredentials
from .import_source_py3 import ImportSource
from .import_image_parameters_py3 import ImportImageParameters
from .registry_name_check_request_py3 import RegistryNameCheckRequest
Expand Down Expand Up @@ -75,6 +76,7 @@
from .build_task_build_request_py3 import BuildTaskBuildRequest
from .quick_build_request_py3 import QuickBuildRequest
except (SyntaxError, ImportError):
from .import_source_credentials import ImportSourceCredentials
from .import_source import ImportSource
from .import_image_parameters import ImportImageParameters
from .registry_name_check_request import RegistryNameCheckRequest
Expand Down Expand Up @@ -170,6 +172,7 @@
)

__all__ = [
'ImportSourceCredentials',
'ImportSource',
'ImportImageParameters',
'RegistryNameCheckRequest',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,12 @@ class ImportSource(Model):
:param resource_id: The resource identifier of the source Azure Container
Registry.
:type resource_id: str
:param registry_uri: The address of the source registry.
:param registry_uri: The address of the source registry (e.g.
'mcr.microsoft.com').
:type registry_uri: str
:param credentials: Credentials used when importing from a registry uri.
:type credentials:
~azure.mgmt.containerregistry.v2018_02_01_preview.models.ImportSourceCredentials
:param source_image: Required. Repository name of the source image.
Specify an image by repository ('hello-world'). This will use the 'latest'
tag.
Expand All @@ -38,11 +42,13 @@ class ImportSource(Model):
_attribute_map = {
'resource_id': {'key': 'resourceId', 'type': 'str'},
'registry_uri': {'key': 'registryUri', 'type': 'str'},
'credentials': {'key': 'credentials', 'type': 'ImportSourceCredentials'},
'source_image': {'key': 'sourceImage', 'type': 'str'},
}

def __init__(self, **kwargs):
super(ImportSource, self).__init__(**kwargs)
self.resource_id = kwargs.get('resource_id', None)
self.registry_uri = kwargs.get('registry_uri', None)
self.credentials = kwargs.get('credentials', None)
self.source_image = kwargs.get('source_image', None)
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# coding=utf-8
# --------------------------------------------------------------------------
# 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.
# --------------------------------------------------------------------------

from msrest.serialization import Model


class ImportSourceCredentials(Model):
"""ImportSourceCredentials.

All required parameters must be populated in order to send to Azure.

:param username: The username to authenticate with the source registry.
:type username: str
:param password: Required. The password used to authenticate with the
source registry.
:type password: str
"""

_validation = {
'password': {'required': True},
}

_attribute_map = {
'username': {'key': 'username', 'type': 'str'},
'password': {'key': 'password', 'type': 'str'},
}

def __init__(self, **kwargs):
super(ImportSourceCredentials, self).__init__(**kwargs)
self.username = kwargs.get('username', None)
self.password = kwargs.get('password', None)
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# coding=utf-8
# --------------------------------------------------------------------------
# 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.
# --------------------------------------------------------------------------

from msrest.serialization import Model


class ImportSourceCredentials(Model):
"""ImportSourceCredentials.

All required parameters must be populated in order to send to Azure.

:param username: The username to authenticate with the source registry.
:type username: str
:param password: Required. The password used to authenticate with the
source registry.
:type password: str
"""

_validation = {
'password': {'required': True},
}

_attribute_map = {
'username': {'key': 'username', 'type': 'str'},
'password': {'key': 'password', 'type': 'str'},
}

def __init__(self, *, password: str, username: str=None, **kwargs) -> None:
super(ImportSourceCredentials, self).__init__(**kwargs)
self.username = username
self.password = password
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,12 @@ class ImportSource(Model):
:param resource_id: The resource identifier of the source Azure Container
Registry.
:type resource_id: str
:param registry_uri: The address of the source registry.
:param registry_uri: The address of the source registry (e.g.
'mcr.microsoft.com').
:type registry_uri: str
:param credentials: Credentials used when importing from a registry uri.
:type credentials:
~azure.mgmt.containerregistry.v2018_02_01_preview.models.ImportSourceCredentials
:param source_image: Required. Repository name of the source image.
Specify an image by repository ('hello-world'). This will use the 'latest'
tag.
Expand All @@ -38,11 +42,13 @@ class ImportSource(Model):
_attribute_map = {
'resource_id': {'key': 'resourceId', 'type': 'str'},
'registry_uri': {'key': 'registryUri', 'type': 'str'},
'credentials': {'key': 'credentials', 'type': 'ImportSourceCredentials'},
'source_image': {'key': 'sourceImage', 'type': 'str'},
}

def __init__(self, *, source_image: str, resource_id: str=None, registry_uri: str=None, **kwargs) -> None:
def __init__(self, *, source_image: str, resource_id: str=None, registry_uri: str=None, credentials=None, **kwargs) -> None:
super(ImportSource, self).__init__(**kwargs)
self.resource_id = resource_id
self.registry_uri = registry_uri
self.credentials = credentials
self.source_image = source_image
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
# --------------------------------------------------------------------------

try:
from .import_source_credentials_py3 import ImportSourceCredentials
from .import_source_py3 import ImportSource
from .import_image_parameters_py3 import ImportImageParameters
from .registry_name_check_request_py3 import RegistryNameCheckRequest
Expand Down Expand Up @@ -88,6 +89,7 @@
from .file_task_step_update_parameters_py3 import FileTaskStepUpdateParameters
from .encoded_task_step_update_parameters_py3 import EncodedTaskStepUpdateParameters
except (SyntaxError, ImportError):
from .import_source_credentials import ImportSourceCredentials
from .import_source import ImportSource
from .import_image_parameters import ImportImageParameters
from .registry_name_check_request import RegistryNameCheckRequest
Expand Down Expand Up @@ -198,6 +200,7 @@
)

__all__ = [
'ImportSourceCredentials',
'ImportSource',
'ImportImageParameters',
'RegistryNameCheckRequest',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,12 @@ class ImportSource(Model):
:param resource_id: The resource identifier of the source Azure Container
Registry.
:type resource_id: str
:param registry_uri: The address of the source registry.
:param registry_uri: The address of the source registry (e.g.
'mcr.microsoft.com').
:type registry_uri: str
:param credentials: Credentials used when importing from a registry uri.
:type credentials:
~azure.mgmt.containerregistry.v2018_09_01.models.ImportSourceCredentials
:param source_image: Required. Repository name of the source image.
Specify an image by repository ('hello-world'). This will use the 'latest'
tag.
Expand All @@ -38,11 +42,13 @@ class ImportSource(Model):
_attribute_map = {
'resource_id': {'key': 'resourceId', 'type': 'str'},
'registry_uri': {'key': 'registryUri', 'type': 'str'},
'credentials': {'key': 'credentials', 'type': 'ImportSourceCredentials'},
'source_image': {'key': 'sourceImage', 'type': 'str'},
}

def __init__(self, **kwargs):
super(ImportSource, self).__init__(**kwargs)
self.resource_id = kwargs.get('resource_id', None)
self.registry_uri = kwargs.get('registry_uri', None)
self.credentials = kwargs.get('credentials', None)
self.source_image = kwargs.get('source_image', None)
Loading