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 #3140

Merged
merged 9 commits into from
Sep 12, 2018
12 changes: 12 additions & 0 deletions azure-mgmt-containerregistry/HISTORY.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,18 @@
Release History
===============

2.2.0 (2018-09-11)
++++++++++++++++++

**Features**

- Added operation RegistriesOperations.get_build_source_upload_url
- Added operation RegistriesOperations.schedule_run
- Added operation group RunsOperations
- Added operation group TasksOperations

Default API version is now 2018-09-01

2.1.0 (2018-07-26)
++++++++++++++++++

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ class ContainerRegistryManagementClient(MultiApiClientMixin, SDKClient):
:param profile: A dict using operation group name to API version.
:type profile: dict[str, str] """

DEFAULT_API_VERSION = '2017-10-01'
DEFAULT_API_VERSION = '2018-09-01'
_PROFILE_TAG = "azure.mgmt.containerregistry.ContainerRegistryManagementClient"
LATEST_PROFILE = ProfileDefinition({
_PROFILE_TAG: {
Expand Down Expand Up @@ -98,6 +98,7 @@ def models(cls, api_version=DEFAULT_API_VERSION):
* 2017-03-01: :mod:`v2017_03_01.models<azure.mgmt.containerregistry.v2017_03_01.models>`
* 2017-10-01: :mod:`v2017_10_01.models<azure.mgmt.containerregistry.v2017_10_01.models>`
* 2018-02-01-preview: :mod:`v2018_02_01_preview.models<azure.mgmt.containerregistry.v2018_02_01_preview.models>`
* 2018-09-01: :mod:`v2018_09_01.models<azure.mgmt.containerregistry.v2018_09_01.models>`
"""
if api_version == '2017-03-01':
from .v2017_03_01 import models
Expand All @@ -108,8 +109,11 @@ def models(cls, api_version=DEFAULT_API_VERSION):
elif api_version == '2018-02-01-preview':
from .v2018_02_01_preview import models
return models
elif api_version == '2018-09-01':
from .v2018_09_01 import models
return models
raise NotImplementedError("APIVersion {} is not available".format(api_version))

@property
def build_steps(self):
"""Instance depends on the API version:
Expand Down Expand Up @@ -156,6 +160,7 @@ def operations(self):
* 2017-03-01: :class:`Operations<azure.mgmt.containerregistry.v2017_03_01.operations.Operations>`
* 2017-10-01: :class:`Operations<azure.mgmt.containerregistry.v2017_10_01.operations.Operations>`
* 2018-02-01-preview: :class:`Operations<azure.mgmt.containerregistry.v2018_02_01_preview.operations.Operations>`
* 2018-09-01: :class:`Operations<azure.mgmt.containerregistry.v2018_09_01.operations.Operations>`
"""
api_version = self._get_api_version('operations')
if api_version == '2017-03-01':
Expand All @@ -164,6 +169,8 @@ def operations(self):
from .v2017_10_01.operations import Operations as OperationClass
elif api_version == '2018-02-01-preview':
from .v2018_02_01_preview.operations import Operations as OperationClass
elif api_version == '2018-09-01':
from .v2018_09_01.operations import Operations as OperationClass
else:
raise NotImplementedError("APIVersion {} is not available".format(api_version))
return OperationClass(self._client, self.config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version)))
Expand All @@ -175,6 +182,7 @@ def registries(self):
* 2017-03-01: :class:`RegistriesOperations<azure.mgmt.containerregistry.v2017_03_01.operations.RegistriesOperations>`
* 2017-10-01: :class:`RegistriesOperations<azure.mgmt.containerregistry.v2017_10_01.operations.RegistriesOperations>`
* 2018-02-01-preview: :class:`RegistriesOperations<azure.mgmt.containerregistry.v2018_02_01_preview.operations.RegistriesOperations>`
* 2018-09-01: :class:`RegistriesOperations<azure.mgmt.containerregistry.v2018_09_01.operations.RegistriesOperations>`
"""
api_version = self._get_api_version('registries')
if api_version == '2017-03-01':
Expand All @@ -183,6 +191,8 @@ def registries(self):
from .v2017_10_01.operations import RegistriesOperations as OperationClass
elif api_version == '2018-02-01-preview':
from .v2018_02_01_preview.operations import RegistriesOperations as OperationClass
elif api_version == '2018-09-01':
from .v2018_09_01.operations import RegistriesOperations as OperationClass
else:
raise NotImplementedError("APIVersion {} is not available".format(api_version))
return OperationClass(self._client, self.config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version)))
Expand All @@ -193,12 +203,41 @@ def replications(self):

* 2017-10-01: :class:`ReplicationsOperations<azure.mgmt.containerregistry.v2017_10_01.operations.ReplicationsOperations>`
* 2018-02-01-preview: :class:`ReplicationsOperations<azure.mgmt.containerregistry.v2018_02_01_preview.operations.ReplicationsOperations>`
* 2018-09-01: :class:`ReplicationsOperations<azure.mgmt.containerregistry.v2018_09_01.operations.ReplicationsOperations>`
"""
api_version = self._get_api_version('replications')
if api_version == '2017-10-01':
from .v2017_10_01.operations import ReplicationsOperations as OperationClass
elif api_version == '2018-02-01-preview':
from .v2018_02_01_preview.operations import ReplicationsOperations as OperationClass
elif api_version == '2018-09-01':
from .v2018_09_01.operations import ReplicationsOperations as OperationClass
else:
raise NotImplementedError("APIVersion {} is not available".format(api_version))
return OperationClass(self._client, self.config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version)))

@property
def runs(self):
"""Instance depends on the API version:

* 2018-09-01: :class:`RunsOperations<azure.mgmt.containerregistry.v2018_09_01.operations.RunsOperations>`
"""
api_version = self._get_api_version('runs')
if api_version == '2018-09-01':
from .v2018_09_01.operations import RunsOperations as OperationClass
else:
raise NotImplementedError("APIVersion {} is not available".format(api_version))
return OperationClass(self._client, self.config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version)))

@property
def tasks(self):
"""Instance depends on the API version:

* 2018-09-01: :class:`TasksOperations<azure.mgmt.containerregistry.v2018_09_01.operations.TasksOperations>`
"""
api_version = self._get_api_version('tasks')
if api_version == '2018-09-01':
from .v2018_09_01.operations import TasksOperations as OperationClass
else:
raise NotImplementedError("APIVersion {} is not available".format(api_version))
return OperationClass(self._client, self.config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version)))
Expand All @@ -209,12 +248,15 @@ def webhooks(self):

* 2017-10-01: :class:`WebhooksOperations<azure.mgmt.containerregistry.v2017_10_01.operations.WebhooksOperations>`
* 2018-02-01-preview: :class:`WebhooksOperations<azure.mgmt.containerregistry.v2018_02_01_preview.operations.WebhooksOperations>`
* 2018-09-01: :class:`WebhooksOperations<azure.mgmt.containerregistry.v2018_09_01.operations.WebhooksOperations>`
"""
api_version = self._get_api_version('webhooks')
if api_version == '2017-10-01':
from .v2017_10_01.operations import WebhooksOperations as OperationClass
elif api_version == '2018-02-01-preview':
from .v2018_02_01_preview.operations import WebhooksOperations as OperationClass
elif api_version == '2018-09-01':
from .v2018_09_01.operations import WebhooksOperations as OperationClass
else:
raise NotImplementedError("APIVersion {} is not available".format(api_version))
return OperationClass(self._client, self.config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version)))
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ def internal_paging(next_link=None, raw=False):

# Construct headers
header_parameters = {}
header_parameters['Content-Type'] = 'application/json; charset=utf-8'
header_parameters['Accept'] = 'application/json'
if self.config.generate_client_request_id:
header_parameters['x-ms-client-request-id'] = str(uuid.uuid1())
if custom_headers:
Expand All @@ -77,9 +77,8 @@ def internal_paging(next_link=None, raw=False):
header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str')

# Construct and send request
request = self._client.get(url, query_parameters)
response = self._client.send(
request, header_parameters, stream=False, **operation_config)
request = self._client.get(url, query_parameters, header_parameters)
response = self._client.send(request, stream=False, **operation_config)

if response.status_code not in [200]:
exp = CloudError(response)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ def check_name_availability(

# Construct headers
header_parameters = {}
header_parameters['Accept'] = 'application/json'
header_parameters['Content-Type'] = 'application/json; charset=utf-8'
if self.config.generate_client_request_id:
header_parameters['x-ms-client-request-id'] = str(uuid.uuid1())
Expand All @@ -85,9 +86,8 @@ def check_name_availability(
body_content = self._serialize.body(registry_name_check_request, 'RegistryNameCheckRequest')

# Construct and send request
request = self._client.post(url, query_parameters)
response = self._client.send(
request, header_parameters, body_content, stream=False, **operation_config)
request = self._client.post(url, query_parameters, header_parameters, body_content)
response = self._client.send(request, stream=False, **operation_config)

if response.status_code not in [200]:
exp = CloudError(response)
Expand Down Expand Up @@ -140,7 +140,7 @@ def get(

# Construct headers
header_parameters = {}
header_parameters['Content-Type'] = 'application/json; charset=utf-8'
header_parameters['Accept'] = 'application/json'
if self.config.generate_client_request_id:
header_parameters['x-ms-client-request-id'] = str(uuid.uuid1())
if custom_headers:
Expand All @@ -149,8 +149,8 @@ def get(
header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str')

# Construct and send request
request = self._client.get(url, query_parameters)
response = self._client.send(request, header_parameters, stream=False, **operation_config)
request = self._client.get(url, query_parameters, header_parameters)
response = self._client.send(request, stream=False, **operation_config)

if response.status_code not in [200]:
exp = CloudError(response)
Expand Down Expand Up @@ -187,6 +187,7 @@ def _create_initial(

# Construct headers
header_parameters = {}
header_parameters['Accept'] = 'application/json'
header_parameters['Content-Type'] = 'application/json; charset=utf-8'
if self.config.generate_client_request_id:
header_parameters['x-ms-client-request-id'] = str(uuid.uuid1())
Expand All @@ -199,9 +200,8 @@ def _create_initial(
body_content = self._serialize.body(registry_create_parameters, 'RegistryCreateParameters')

# Construct and send request
request = self._client.put(url, query_parameters)
response = self._client.send(
request, header_parameters, body_content, stream=False, **operation_config)
request = self._client.put(url, query_parameters, header_parameters, body_content)
response = self._client.send(request, stream=False, **operation_config)

if response.status_code not in [200, 202]:
exp = CloudError(response)
Expand Down Expand Up @@ -305,7 +305,6 @@ def delete(

# Construct headers
header_parameters = {}
header_parameters['Content-Type'] = 'application/json; charset=utf-8'
if self.config.generate_client_request_id:
header_parameters['x-ms-client-request-id'] = str(uuid.uuid1())
if custom_headers:
Expand All @@ -314,8 +313,8 @@ def delete(
header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str')

# Construct and send request
request = self._client.delete(url, query_parameters)
response = self._client.send(request, header_parameters, stream=False, **operation_config)
request = self._client.delete(url, query_parameters, header_parameters)
response = self._client.send(request, stream=False, **operation_config)

if response.status_code not in [200, 204]:
exp = CloudError(response)
Expand Down Expand Up @@ -365,6 +364,7 @@ def update(

# Construct headers
header_parameters = {}
header_parameters['Accept'] = 'application/json'
header_parameters['Content-Type'] = 'application/json; charset=utf-8'
if self.config.generate_client_request_id:
header_parameters['x-ms-client-request-id'] = str(uuid.uuid1())
Expand All @@ -377,9 +377,8 @@ def update(
body_content = self._serialize.body(registry_update_parameters, 'RegistryUpdateParameters')

# Construct and send request
request = self._client.patch(url, query_parameters)
response = self._client.send(
request, header_parameters, body_content, stream=False, **operation_config)
request = self._client.patch(url, query_parameters, header_parameters, body_content)
response = self._client.send(request, stream=False, **operation_config)

if response.status_code not in [200]:
exp = CloudError(response)
Expand Down Expand Up @@ -436,7 +435,7 @@ def internal_paging(next_link=None, raw=False):

# Construct headers
header_parameters = {}
header_parameters['Content-Type'] = 'application/json; charset=utf-8'
header_parameters['Accept'] = 'application/json'
if self.config.generate_client_request_id:
header_parameters['x-ms-client-request-id'] = str(uuid.uuid1())
if custom_headers:
Expand All @@ -445,9 +444,8 @@ def internal_paging(next_link=None, raw=False):
header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str')

# Construct and send request
request = self._client.get(url, query_parameters)
response = self._client.send(
request, header_parameters, stream=False, **operation_config)
request = self._client.get(url, query_parameters, header_parameters)
response = self._client.send(request, stream=False, **operation_config)

if response.status_code not in [200]:
exp = CloudError(response)
Expand Down Expand Up @@ -501,7 +499,7 @@ def internal_paging(next_link=None, raw=False):

# Construct headers
header_parameters = {}
header_parameters['Content-Type'] = 'application/json; charset=utf-8'
header_parameters['Accept'] = 'application/json'
if self.config.generate_client_request_id:
header_parameters['x-ms-client-request-id'] = str(uuid.uuid1())
if custom_headers:
Expand All @@ -510,9 +508,8 @@ def internal_paging(next_link=None, raw=False):
header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str')

# Construct and send request
request = self._client.get(url, query_parameters)
response = self._client.send(
request, header_parameters, stream=False, **operation_config)
request = self._client.get(url, query_parameters, header_parameters)
response = self._client.send(request, stream=False, **operation_config)

if response.status_code not in [200]:
exp = CloudError(response)
Expand Down Expand Up @@ -568,7 +565,7 @@ def list_credentials(

# Construct headers
header_parameters = {}
header_parameters['Content-Type'] = 'application/json; charset=utf-8'
header_parameters['Accept'] = 'application/json'
if self.config.generate_client_request_id:
header_parameters['x-ms-client-request-id'] = str(uuid.uuid1())
if custom_headers:
Expand All @@ -577,8 +574,8 @@ def list_credentials(
header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str')

# Construct and send request
request = self._client.post(url, query_parameters)
response = self._client.send(request, header_parameters, stream=False, **operation_config)
request = self._client.post(url, query_parameters, header_parameters)
response = self._client.send(request, stream=False, **operation_config)

if response.status_code not in [200]:
exp = CloudError(response)
Expand Down Expand Up @@ -641,6 +638,7 @@ def regenerate_credential(

# Construct headers
header_parameters = {}
header_parameters['Accept'] = 'application/json'
header_parameters['Content-Type'] = 'application/json; charset=utf-8'
if self.config.generate_client_request_id:
header_parameters['x-ms-client-request-id'] = str(uuid.uuid1())
Expand All @@ -653,9 +651,8 @@ def regenerate_credential(
body_content = self._serialize.body(regenerate_credential_parameters, 'RegenerateCredentialParameters')

# Construct and send request
request = self._client.post(url, query_parameters)
response = self._client.send(
request, header_parameters, body_content, stream=False, **operation_config)
request = self._client.post(url, query_parameters, header_parameters, body_content)
response = self._client.send(request, stream=False, **operation_config)

if response.status_code not in [200]:
exp = CloudError(response)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,11 @@ class ImportSource(Model):

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

:param resource_id: Required. The resource identifier of the target Azure
Container Registry.
: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.
:type registry_uri: str
: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 @@ -30,16 +32,17 @@ class ImportSource(Model):
"""

_validation = {
'resource_id': {'required': True},
'source_image': {'required': True},
}

_attribute_map = {
'resource_id': {'key': 'resourceId', 'type': 'str'},
'registry_uri': {'key': 'registryUri', 'type': 'str'},
'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.source_image = kwargs.get('source_image', None)
Loading