diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/_container_registry_management_client.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/_container_registry_management_client.py index 2285ddea6a73..8c255771a71b 100644 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/_container_registry_management_client.py +++ b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/_container_registry_management_client.py @@ -286,6 +286,19 @@ def scope_maps(self): 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 task_runs(self): + """Instance depends on the API version: + + * 2019-06-01-preview: :class:`TaskRunsOperations` + """ + api_version = self._get_api_version('task_runs') + if api_version == '2019-06-01-preview': + from .v2019_06_01_preview.operations import TaskRunsOperations 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: diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_06_01_preview/_container_registry_management_client.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_06_01_preview/_container_registry_management_client.py index ef41c8030ce1..83f4fb5b4cc1 100644 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_06_01_preview/_container_registry_management_client.py +++ b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_06_01_preview/_container_registry_management_client.py @@ -18,6 +18,7 @@ from .operations import ReplicationsOperations from .operations import WebhooksOperations from .operations import RunsOperations +from .operations import TaskRunsOperations from .operations import TasksOperations from .operations import ScopeMapsOperations from .operations import TokensOperations @@ -40,6 +41,8 @@ class ContainerRegistryManagementClient(SDKClient): :vartype webhooks: azure.mgmt.containerregistry.v2019_06_01_preview.operations.WebhooksOperations :ivar runs: Runs operations :vartype runs: azure.mgmt.containerregistry.v2019_06_01_preview.operations.RunsOperations + :ivar task_runs: TaskRuns operations + :vartype task_runs: azure.mgmt.containerregistry.v2019_06_01_preview.operations.TaskRunsOperations :ivar tasks: Tasks operations :vartype tasks: azure.mgmt.containerregistry.v2019_06_01_preview.operations.TasksOperations :ivar scope_maps: ScopeMaps operations @@ -75,6 +78,8 @@ def __init__( self._client, self.config, self._serialize, self._deserialize) self.runs = RunsOperations( self._client, self.config, self._serialize, self._deserialize) + self.task_runs = TaskRunsOperations( + self._client, self.config, self._serialize, self._deserialize) self.tasks = TasksOperations( self._client, self.config, self._serialize, self._deserialize) self.scope_maps = ScopeMapsOperations( diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_06_01_preview/models/__init__.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_06_01_preview/models/__init__.py index 5c415f0b5959..021c7a5c91e2 100644 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_06_01_preview/models/__init__.py +++ b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_06_01_preview/models/__init__.py @@ -27,6 +27,8 @@ from ._models_py3 import EncodedTaskRunRequest from ._models_py3 import EncodedTaskStep from ._models_py3 import EncodedTaskStepUpdateParameters + from ._models_py3 import Error + from ._models_py3 import ErrorSchema, ErrorSchemaException from ._models_py3 import Event from ._models_py3 import EventContent from ._models_py3 import EventInfo @@ -91,7 +93,9 @@ from ._models_py3 import StorageAccountProperties from ._models_py3 import Target from ._models_py3 import Task + from ._models_py3 import TaskRun from ._models_py3 import TaskRunRequest + from ._models_py3 import TaskRunUpdateParameters from ._models_py3 import TaskStepProperties from ._models_py3 import TaskStepUpdateParameters from ._models_py3 import TaskUpdateParameters @@ -129,6 +133,8 @@ from ._models import EncodedTaskRunRequest from ._models import EncodedTaskStep from ._models import EncodedTaskStepUpdateParameters + from ._models import Error + from ._models import ErrorSchema, ErrorSchemaException from ._models import Event from ._models import EventContent from ._models import EventInfo @@ -193,7 +199,9 @@ from ._models import StorageAccountProperties from ._models import Target from ._models import Task + from ._models import TaskRun from ._models import TaskRunRequest + from ._models import TaskRunUpdateParameters from ._models import TaskStepProperties from ._models import TaskStepUpdateParameters from ._models import TaskUpdateParameters @@ -220,6 +228,7 @@ from ._paged_models import RunPaged from ._paged_models import ScopeMapPaged from ._paged_models import TaskPaged +from ._paged_models import TaskRunPaged from ._paged_models import TokenPaged from ._paged_models import WebhookPaged from ._container_registry_management_client_enums import ( @@ -274,6 +283,8 @@ 'EncodedTaskRunRequest', 'EncodedTaskStep', 'EncodedTaskStepUpdateParameters', + 'Error', + 'ErrorSchema', 'ErrorSchemaException', 'Event', 'EventContent', 'EventInfo', @@ -338,7 +349,9 @@ 'StorageAccountProperties', 'Target', 'Task', + 'TaskRun', 'TaskRunRequest', + 'TaskRunUpdateParameters', 'TaskStepProperties', 'TaskStepUpdateParameters', 'TaskUpdateParameters', @@ -364,6 +377,7 @@ 'WebhookPaged', 'EventPaged', 'RunPaged', + 'TaskRunPaged', 'TaskPaged', 'ScopeMapPaged', 'TokenPaged', diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_06_01_preview/models/_models.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_06_01_preview/models/_models.py index 68fe738f195c..f3f9dd0e169f 100644 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_06_01_preview/models/_models.py +++ b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_06_01_preview/models/_models.py @@ -10,6 +10,7 @@ # -------------------------------------------------------------------------- from msrest.serialization import Model +from msrest.exceptions import HttpOperationError class Actor(Model): @@ -895,6 +896,62 @@ def __init__(self, **kwargs): self.type = 'EncodedTask' +class Error(Model): + """An error response from the Azure Container Registry service. + + All required parameters must be populated in order to send to Azure. + + :param code: Required. error code. + :type code: str + :param message: Required. error message. + :type message: str + """ + + _validation = { + 'code': {'required': True}, + 'message': {'required': True}, + } + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(Error, self).__init__(**kwargs) + self.code = kwargs.get('code', None) + self.message = kwargs.get('message', None) + + +class ErrorSchema(Model): + """An error response from the Azure Container Registry service. + + :param error: Azure container registry build API error body. + :type error: + ~azure.mgmt.containerregistry.v2019_06_01_preview.models.Error + """ + + _attribute_map = { + 'error': {'key': 'error', 'type': 'Error'}, + } + + def __init__(self, **kwargs): + super(ErrorSchema, self).__init__(**kwargs) + self.error = kwargs.get('error', None) + + +class ErrorSchemaException(HttpOperationError): + """Server responsed with exception of type: 'ErrorSchema'. + + :param deserialize: A deserializer + :param response: Server response to be deserialized. + """ + + def __init__(self, deserialize, response, *args): + + super(ErrorSchemaException, self).__init__(deserialize, response, 'ErrorSchema', *args) + + class EventInfo(Model): """The basic information of an event. @@ -3193,6 +3250,76 @@ def __init__(self, **kwargs): self.credentials = kwargs.get('credentials', None) +class TaskRun(Resource): + """The task run that has the ARM resource and properties. + The task run will have the information of request and result of a run. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: The resource ID. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. + :vartype type: str + :param location: Required. The location of the resource. This cannot be + changed after the resource is created. + :type location: str + :param tags: The tags of the resource. + :type tags: dict[str, str] + :param identity: Identity for the resource. + :type identity: + ~azure.mgmt.containerregistry.v2019_06_01_preview.models.IdentityProperties + :ivar provisioning_state: The provisioning state of this task run. + Possible values include: 'Creating', 'Updating', 'Deleting', 'Succeeded', + 'Failed', 'Canceled' + :vartype provisioning_state: str or + ~azure.mgmt.containerregistry.v2019_06_01_preview.models.ProvisioningState + :param run_request: The request (parameters) for the run + :type run_request: + ~azure.mgmt.containerregistry.v2019_06_01_preview.models.RunRequest + :ivar run_result: The result of this task run + :vartype run_result: + ~azure.mgmt.containerregistry.v2019_06_01_preview.models.Run + :param force_update_tag: How the run should be forced to rerun even if the + run request configuration has not changed + :type force_update_tag: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': True}, + 'provisioning_state': {'readonly': True}, + 'run_result': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'identity': {'key': 'identity', 'type': 'IdentityProperties'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'run_request': {'key': 'properties.runRequest', 'type': 'RunRequest'}, + 'run_result': {'key': 'properties.runResult', 'type': 'Run'}, + 'force_update_tag': {'key': 'properties.forceUpdateTag', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(TaskRun, self).__init__(**kwargs) + self.identity = kwargs.get('identity', None) + self.provisioning_state = None + self.run_request = kwargs.get('run_request', None) + self.run_result = None + self.force_update_tag = kwargs.get('force_update_tag', None) + + class TaskRunRequest(RunRequest): """The parameters for a task run request. @@ -3231,6 +3358,37 @@ def __init__(self, **kwargs): self.type = 'TaskRunRequest' +class TaskRunUpdateParameters(Model): + """The parameters for updating a task run. + + :param identity: Identity for the resource. + :type identity: + ~azure.mgmt.containerregistry.v2019_06_01_preview.models.IdentityProperties + :param run_request: The request (parameters) for the new run + :type run_request: + ~azure.mgmt.containerregistry.v2019_06_01_preview.models.RunRequest + :param force_update_tag: How the run should be forced to rerun even if the + run request configuration has not changed + :type force_update_tag: str + :param tags: The ARM resource tags. + :type tags: dict[str, str] + """ + + _attribute_map = { + 'identity': {'key': 'identity', 'type': 'IdentityProperties'}, + 'run_request': {'key': 'properties.runRequest', 'type': 'RunRequest'}, + 'force_update_tag': {'key': 'properties.forceUpdateTag', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__(self, **kwargs): + super(TaskRunUpdateParameters, self).__init__(**kwargs) + self.identity = kwargs.get('identity', None) + self.run_request = kwargs.get('run_request', None) + self.force_update_tag = kwargs.get('force_update_tag', None) + self.tags = kwargs.get('tags', None) + + class TaskUpdateParameters(Model): """The parameters for updating a task. diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_06_01_preview/models/_models_py3.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_06_01_preview/models/_models_py3.py index 9fa2343716dd..6888cdc1b472 100644 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_06_01_preview/models/_models_py3.py +++ b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_06_01_preview/models/_models_py3.py @@ -10,6 +10,7 @@ # -------------------------------------------------------------------------- from msrest.serialization import Model +from msrest.exceptions import HttpOperationError class Actor(Model): @@ -895,6 +896,62 @@ def __init__(self, *, context_path: str=None, context_access_token: str=None, en self.type = 'EncodedTask' +class Error(Model): + """An error response from the Azure Container Registry service. + + All required parameters must be populated in order to send to Azure. + + :param code: Required. error code. + :type code: str + :param message: Required. error message. + :type message: str + """ + + _validation = { + 'code': {'required': True}, + 'message': {'required': True}, + } + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + } + + def __init__(self, *, code: str, message: str, **kwargs) -> None: + super(Error, self).__init__(**kwargs) + self.code = code + self.message = message + + +class ErrorSchema(Model): + """An error response from the Azure Container Registry service. + + :param error: Azure container registry build API error body. + :type error: + ~azure.mgmt.containerregistry.v2019_06_01_preview.models.Error + """ + + _attribute_map = { + 'error': {'key': 'error', 'type': 'Error'}, + } + + def __init__(self, *, error=None, **kwargs) -> None: + super(ErrorSchema, self).__init__(**kwargs) + self.error = error + + +class ErrorSchemaException(HttpOperationError): + """Server responsed with exception of type: 'ErrorSchema'. + + :param deserialize: A deserializer + :param response: Server response to be deserialized. + """ + + def __init__(self, deserialize, response, *args): + + super(ErrorSchemaException, self).__init__(deserialize, response, 'ErrorSchema', *args) + + class EventInfo(Model): """The basic information of an event. @@ -3193,6 +3250,76 @@ def __init__(self, *, location: str, platform, step, tags=None, identity=None, s self.credentials = credentials +class TaskRun(Resource): + """The task run that has the ARM resource and properties. + The task run will have the information of request and result of a run. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: The resource ID. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. + :vartype type: str + :param location: Required. The location of the resource. This cannot be + changed after the resource is created. + :type location: str + :param tags: The tags of the resource. + :type tags: dict[str, str] + :param identity: Identity for the resource. + :type identity: + ~azure.mgmt.containerregistry.v2019_06_01_preview.models.IdentityProperties + :ivar provisioning_state: The provisioning state of this task run. + Possible values include: 'Creating', 'Updating', 'Deleting', 'Succeeded', + 'Failed', 'Canceled' + :vartype provisioning_state: str or + ~azure.mgmt.containerregistry.v2019_06_01_preview.models.ProvisioningState + :param run_request: The request (parameters) for the run + :type run_request: + ~azure.mgmt.containerregistry.v2019_06_01_preview.models.RunRequest + :ivar run_result: The result of this task run + :vartype run_result: + ~azure.mgmt.containerregistry.v2019_06_01_preview.models.Run + :param force_update_tag: How the run should be forced to rerun even if the + run request configuration has not changed + :type force_update_tag: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': True}, + 'provisioning_state': {'readonly': True}, + 'run_result': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'identity': {'key': 'identity', 'type': 'IdentityProperties'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'run_request': {'key': 'properties.runRequest', 'type': 'RunRequest'}, + 'run_result': {'key': 'properties.runResult', 'type': 'Run'}, + 'force_update_tag': {'key': 'properties.forceUpdateTag', 'type': 'str'}, + } + + def __init__(self, *, location: str, tags=None, identity=None, run_request=None, force_update_tag: str=None, **kwargs) -> None: + super(TaskRun, self).__init__(location=location, tags=tags, **kwargs) + self.identity = identity + self.provisioning_state = None + self.run_request = run_request + self.run_result = None + self.force_update_tag = force_update_tag + + class TaskRunRequest(RunRequest): """The parameters for a task run request. @@ -3231,6 +3358,37 @@ def __init__(self, *, task_id: str, is_archive_enabled: bool=False, override_tas self.type = 'TaskRunRequest' +class TaskRunUpdateParameters(Model): + """The parameters for updating a task run. + + :param identity: Identity for the resource. + :type identity: + ~azure.mgmt.containerregistry.v2019_06_01_preview.models.IdentityProperties + :param run_request: The request (parameters) for the new run + :type run_request: + ~azure.mgmt.containerregistry.v2019_06_01_preview.models.RunRequest + :param force_update_tag: How the run should be forced to rerun even if the + run request configuration has not changed + :type force_update_tag: str + :param tags: The ARM resource tags. + :type tags: dict[str, str] + """ + + _attribute_map = { + 'identity': {'key': 'identity', 'type': 'IdentityProperties'}, + 'run_request': {'key': 'properties.runRequest', 'type': 'RunRequest'}, + 'force_update_tag': {'key': 'properties.forceUpdateTag', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__(self, *, identity=None, run_request=None, force_update_tag: str=None, tags=None, **kwargs) -> None: + super(TaskRunUpdateParameters, self).__init__(**kwargs) + self.identity = identity + self.run_request = run_request + self.force_update_tag = force_update_tag + self.tags = tags + + class TaskUpdateParameters(Model): """The parameters for updating a task. diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_06_01_preview/models/_paged_models.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_06_01_preview/models/_paged_models.py index b91aff5d1e12..62da7b150809 100644 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_06_01_preview/models/_paged_models.py +++ b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_06_01_preview/models/_paged_models.py @@ -90,6 +90,19 @@ class RunPaged(Paged): def __init__(self, *args, **kwargs): super(RunPaged, self).__init__(*args, **kwargs) +class TaskRunPaged(Paged): + """ + A paging container for iterating over a list of :class:`TaskRun ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[TaskRun]'} + } + + def __init__(self, *args, **kwargs): + + super(TaskRunPaged, self).__init__(*args, **kwargs) class TaskPaged(Paged): """ A paging container for iterating over a list of :class:`Task ` object diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_06_01_preview/operations/__init__.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_06_01_preview/operations/__init__.py index d50454ded73d..fe07fc43b190 100644 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_06_01_preview/operations/__init__.py +++ b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_06_01_preview/operations/__init__.py @@ -14,6 +14,7 @@ from ._replications_operations import ReplicationsOperations from ._webhooks_operations import WebhooksOperations from ._runs_operations import RunsOperations +from ._task_runs_operations import TaskRunsOperations from ._tasks_operations import TasksOperations from ._scope_maps_operations import ScopeMapsOperations from ._tokens_operations import TokensOperations @@ -24,6 +25,7 @@ 'ReplicationsOperations', 'WebhooksOperations', 'RunsOperations', + 'TaskRunsOperations', 'TasksOperations', 'ScopeMapsOperations', 'TokensOperations', diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_06_01_preview/operations/_registries_operations.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_06_01_preview/operations/_registries_operations.py index 25396f418919..ef37748768d4 100644 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_06_01_preview/operations/_registries_operations.py +++ b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_06_01_preview/operations/_registries_operations.py @@ -945,9 +945,7 @@ def _schedule_run_initial( response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200, 202]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp + raise models.ErrorSchemaException(self._deserialize, response) deserialized = None @@ -984,7 +982,8 @@ def schedule_run( ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.containerregistry.v2019_06_01_preview.models.Run] or ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.containerregistry.v2019_06_01_preview.models.Run]] - :raises: :class:`CloudError` + :raises: + :class:`ErrorSchemaException` """ raw_result = self._schedule_run_initial( resource_group_name=resource_group_name, @@ -1031,7 +1030,8 @@ def get_build_source_upload_url( :rtype: ~azure.mgmt.containerregistry.v2019_06_01_preview.models.SourceUploadDefinition or ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` + :raises: + :class:`ErrorSchemaException` """ api_version = "2019-06-01-preview" @@ -1063,9 +1063,7 @@ def get_build_source_upload_url( response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp + raise models.ErrorSchemaException(self._deserialize, response) deserialized = None if response.status_code == 200: diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_06_01_preview/operations/_runs_operations.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_06_01_preview/operations/_runs_operations.py index 2bf8392db7e0..ac83e4f62e25 100644 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_06_01_preview/operations/_runs_operations.py +++ b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_06_01_preview/operations/_runs_operations.py @@ -11,7 +11,6 @@ import uuid from msrest.pipeline import ClientRawResponse -from msrestazure.azure_exceptions import CloudError from msrest.polling import LROPoller, NoPolling from msrestazure.polling.arm_polling import ARMPolling @@ -66,7 +65,8 @@ def list( :return: An iterator like instance of Run :rtype: ~azure.mgmt.containerregistry.v2019_06_01_preview.models.RunPaged[~azure.mgmt.containerregistry.v2019_06_01_preview.models.Run] - :raises: :class:`CloudError` + :raises: + :class:`ErrorSchemaException` """ def prepare_request(next_link=None): if not next_link: @@ -111,9 +111,7 @@ def internal_paging(next_link=None): response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp + raise models.ErrorSchemaException(self._deserialize, response) return response @@ -145,7 +143,8 @@ def get( :return: Run or ClientRawResponse if raw=true :rtype: ~azure.mgmt.containerregistry.v2019_06_01_preview.models.Run or ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` + :raises: + :class:`ErrorSchemaException` """ # Construct URL url = self.get.metadata['url'] @@ -176,9 +175,7 @@ def get( response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp + raise models.ErrorSchemaException(self._deserialize, response) deserialized = None if response.status_code == 200: @@ -229,9 +226,7 @@ def _update_initial( response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200, 201]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp + raise models.ErrorSchemaException(self._deserialize, response) deserialized = None @@ -271,7 +266,8 @@ def update( ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.containerregistry.v2019_06_01_preview.models.Run] or ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.containerregistry.v2019_06_01_preview.models.Run]] - :raises: :class:`CloudError` + :raises: + :class:`ErrorSchemaException` """ raw_result = self._update_initial( resource_group_name=resource_group_name, @@ -321,7 +317,8 @@ def get_log_sas_url( :rtype: ~azure.mgmt.containerregistry.v2019_06_01_preview.models.RunGetLogResult or ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` + :raises: + :class:`ErrorSchemaException` """ # Construct URL url = self.get_log_sas_url.metadata['url'] @@ -352,9 +349,7 @@ def get_log_sas_url( response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp + raise models.ErrorSchemaException(self._deserialize, response) deserialized = None if response.status_code == 200: @@ -398,9 +393,7 @@ def _cancel_initial( response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200, 202]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp + raise models.ErrorSchemaException(self._deserialize, response) if raw: client_raw_response = ClientRawResponse(None, response) @@ -426,7 +419,8 @@ def cancel( ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] - :raises: :class:`CloudError` + :raises: + :class:`ErrorSchemaException` """ raw_result = self._cancel_initial( resource_group_name=resource_group_name, diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_06_01_preview/operations/_task_runs_operations.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_06_01_preview/operations/_task_runs_operations.py new file mode 100644 index 000000000000..cada44ad3e40 --- /dev/null +++ b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_06_01_preview/operations/_task_runs_operations.py @@ -0,0 +1,476 @@ +# 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. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse +from msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling + +from .. import models + + +class TaskRunsOperations(object): + """TaskRunsOperations operations. + + You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: The client API version. Constant value: "2019-06-01-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2019-06-01-preview" + + self.config = config + + def get( + self, resource_group_name, registry_name, task_run_name, custom_headers=None, raw=False, **operation_config): + """Gets the detailed information for a given task run. + + :param resource_group_name: The name of the resource group to which + the container registry belongs. + :type resource_group_name: str + :param registry_name: The name of the container registry. + :type registry_name: str + :param task_run_name: The run request name. + :type task_run_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: TaskRun or ClientRawResponse if raw=true + :rtype: + ~azure.mgmt.containerregistry.v2019_06_01_preview.models.TaskRun or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorSchemaException` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), + 'registryName': self._serialize.url("registry_name", registry_name, 'str', max_length=50, min_length=5, pattern=r'^[a-zA-Z0-9]*$'), + 'taskRunName': self._serialize.url("task_run_name", task_run_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + 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: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + 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, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorSchemaException(self._deserialize, response) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('TaskRun', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/taskRuns/{taskRunName}'} + + + def _create_initial( + self, resource_group_name, registry_name, task_run_name, task_run, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.create.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), + 'registryName': self._serialize.url("registry_name", registry_name, 'str', max_length=50, min_length=5, pattern=r'^[a-zA-Z0-9]*$'), + 'taskRunName': self._serialize.url("task_run_name", task_run_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # 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()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(task_run, 'TaskRun') + + # Construct and send request + 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, 201]: + raise models.ErrorSchemaException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('TaskRun', response) + if response.status_code == 201: + deserialized = self._deserialize('TaskRun', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def create( + self, resource_group_name, registry_name, task_run_name, task_run, custom_headers=None, raw=False, polling=True, **operation_config): + """Creates a task run for a container registry with the specified + parameters. + + :param resource_group_name: The name of the resource group to which + the container registry belongs. + :type resource_group_name: str + :param registry_name: The name of the container registry. + :type registry_name: str + :param task_run_name: The name of task run. + :type task_run_name: str + :param task_run: The parameters of a run that needs to scheduled. + :type task_run: + ~azure.mgmt.containerregistry.v2019_06_01_preview.models.TaskRun + :param dict custom_headers: headers that will be added to the request + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns TaskRun or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.containerregistry.v2019_06_01_preview.models.TaskRun] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.containerregistry.v2019_06_01_preview.models.TaskRun]] + :raises: + :class:`ErrorSchemaException` + """ + raw_result = self._create_initial( + resource_group_name=resource_group_name, + registry_name=registry_name, + task_run_name=task_run_name, + task_run=task_run, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('TaskRun', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/taskRuns/{taskRunName}'} + + + def _delete_initial( + self, resource_group_name, registry_name, task_run_name, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.delete.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), + 'registryName': self._serialize.url("registry_name", registry_name, 'str', max_length=50, min_length=5, pattern=r'^[a-zA-Z0-9]*$'), + 'taskRunName': self._serialize.url("task_run_name", task_run_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + 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, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 202, 204]: + raise models.ErrorSchemaException(self._deserialize, response) + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + + def delete( + self, resource_group_name, registry_name, task_run_name, custom_headers=None, raw=False, polling=True, **operation_config): + """Deletes a specified task run resource. + + :param resource_group_name: The name of the resource group to which + the container registry belongs. + :type resource_group_name: str + :param registry_name: The name of the container registry. + :type registry_name: str + :param task_run_name: The task run name. + :type task_run_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns None or + ClientRawResponse if raw==True + :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] + :raises: + :class:`ErrorSchemaException` + """ + raw_result = self._delete_initial( + resource_group_name=resource_group_name, + registry_name=registry_name, + task_run_name=task_run_name, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/taskRuns/{taskRunName}'} + + + def _update_initial( + self, resource_group_name, registry_name, task_run_name, update_parameters, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.update.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), + 'registryName': self._serialize.url("registry_name", registry_name, 'str', max_length=50, min_length=5, pattern=r'^[a-zA-Z0-9]*$'), + 'taskRunName': self._serialize.url("task_run_name", task_run_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # 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()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(update_parameters, 'TaskRunUpdateParameters') + + # Construct and send request + 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, 201]: + raise models.ErrorSchemaException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('TaskRun', response) + if response.status_code == 201: + deserialized = self._deserialize('TaskRun', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def update( + self, resource_group_name, registry_name, task_run_name, update_parameters, custom_headers=None, raw=False, polling=True, **operation_config): + """Updates a task run with the specified parameters. + + :param resource_group_name: The name of the resource group to which + the container registry belongs. + :type resource_group_name: str + :param registry_name: The name of the container registry. + :type registry_name: str + :param task_run_name: The task run name. + :type task_run_name: str + :param update_parameters: The parameters for updating a task run. + :type update_parameters: + ~azure.mgmt.containerregistry.v2019_06_01_preview.models.TaskRunUpdateParameters + :param dict custom_headers: headers that will be added to the request + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns TaskRun or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.containerregistry.v2019_06_01_preview.models.TaskRun] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.containerregistry.v2019_06_01_preview.models.TaskRun]] + :raises: + :class:`ErrorSchemaException` + """ + raw_result = self._update_initial( + resource_group_name=resource_group_name, + registry_name=registry_name, + task_run_name=task_run_name, + update_parameters=update_parameters, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('TaskRun', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/taskRuns/{taskRunName}'} + + def list( + self, resource_group_name, registry_name, custom_headers=None, raw=False, **operation_config): + """Lists all the task runs for a specified container registry. + + :param resource_group_name: The name of the resource group to which + the container registry belongs. + :type resource_group_name: str + :param registry_name: The name of the container registry. + :type registry_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of TaskRun + :rtype: + ~azure.mgmt.containerregistry.v2019_06_01_preview.models.TaskRunPaged[~azure.mgmt.containerregistry.v2019_06_01_preview.models.TaskRun] + :raises: + :class:`ErrorSchemaException` + """ + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1), + 'registryName': self._serialize.url("registry_name", registry_name, 'str', max_length=50, min_length=5, pattern=r'^[a-zA-Z0-9]*$') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + 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: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + 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, header_parameters) + return request + + def internal_paging(next_link=None): + request = prepare_request(next_link) + + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorSchemaException(self._deserialize, response) + + return response + + # Deserialize response + header_dict = None + if raw: + header_dict = {} + deserialized = models.TaskRunPaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/taskRuns'} diff --git a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_06_01_preview/operations/_tasks_operations.py b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_06_01_preview/operations/_tasks_operations.py index 54bd55b7a2cf..cfba40561422 100644 --- a/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_06_01_preview/operations/_tasks_operations.py +++ b/sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_06_01_preview/operations/_tasks_operations.py @@ -11,7 +11,6 @@ import uuid from msrest.pipeline import ClientRawResponse -from msrestazure.azure_exceptions import CloudError from msrest.polling import LROPoller, NoPolling from msrestazure.polling.arm_polling import ARMPolling @@ -58,7 +57,8 @@ def list( :return: An iterator like instance of Task :rtype: ~azure.mgmt.containerregistry.v2019_06_01_preview.models.TaskPaged[~azure.mgmt.containerregistry.v2019_06_01_preview.models.Task] - :raises: :class:`CloudError` + :raises: + :class:`ErrorSchemaException` """ def prepare_request(next_link=None): if not next_link: @@ -99,9 +99,7 @@ def internal_paging(next_link=None): response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp + raise models.ErrorSchemaException(self._deserialize, response) return response @@ -133,7 +131,8 @@ def get( :return: Task or ClientRawResponse if raw=true :rtype: ~azure.mgmt.containerregistry.v2019_06_01_preview.models.Task or ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` + :raises: + :class:`ErrorSchemaException` """ # Construct URL url = self.get.metadata['url'] @@ -164,9 +163,7 @@ def get( response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp + raise models.ErrorSchemaException(self._deserialize, response) deserialized = None if response.status_code == 200: @@ -215,9 +212,7 @@ def _create_initial( response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200, 201]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp + raise models.ErrorSchemaException(self._deserialize, response) deserialized = None @@ -257,7 +252,8 @@ def create( ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.containerregistry.v2019_06_01_preview.models.Task] or ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.containerregistry.v2019_06_01_preview.models.Task]] - :raises: :class:`CloudError` + :raises: + :class:`ErrorSchemaException` """ raw_result = self._create_initial( resource_group_name=resource_group_name, @@ -318,9 +314,7 @@ def _delete_initial( response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200, 202, 204]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp + raise models.ErrorSchemaException(self._deserialize, response) if raw: client_raw_response = ClientRawResponse(None, response) @@ -346,7 +340,8 @@ def delete( ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] - :raises: :class:`CloudError` + :raises: + :class:`ErrorSchemaException` """ raw_result = self._delete_initial( resource_group_name=resource_group_name, @@ -407,9 +402,7 @@ def _update_initial( response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200, 201]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp + raise models.ErrorSchemaException(self._deserialize, response) deserialized = None @@ -449,7 +442,8 @@ def update( ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.containerregistry.v2019_06_01_preview.models.Task] or ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.containerregistry.v2019_06_01_preview.models.Task]] - :raises: :class:`CloudError` + :raises: + :class:`ErrorSchemaException` """ raw_result = self._update_initial( resource_group_name=resource_group_name, @@ -498,7 +492,8 @@ def get_details( :return: Task or ClientRawResponse if raw=true :rtype: ~azure.mgmt.containerregistry.v2019_06_01_preview.models.Task or ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` + :raises: + :class:`ErrorSchemaException` """ # Construct URL url = self.get_details.metadata['url'] @@ -529,9 +524,7 @@ def get_details( response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp + raise models.ErrorSchemaException(self._deserialize, response) deserialized = None if response.status_code == 200: