diff --git a/azure-mgmt-containerregistry/azure/mgmt/containerregistry/container_registry_management_client.py b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/container_registry_management_client.py index 6cc46c2522ff..5407a3109103 100644 --- a/azure-mgmt-containerregistry/azure/mgmt/containerregistry/container_registry_management_client.py +++ b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/container_registry_management_client.py @@ -97,7 +97,7 @@ def models(cls, api_version=DEFAULT_API_VERSION): * 2017-03-01: :mod:`v2017_03_01.models` * 2017-10-01: :mod:`v2017_10_01.models` - * 2018-02-01-preview: :mod:`v2018_02_01_preview.models` + * 2017-10-01: :mod:`v2018_02_01_preview.models` """ if api_version == '2017-03-01': from .v2017_03_01 import models @@ -105,7 +105,7 @@ def models(cls, api_version=DEFAULT_API_VERSION): elif api_version == '2017-10-01': from .v2017_10_01 import models return models - elif api_version == '2018-02-01-preview': + elif api_version == '2017-10-01': from .v2018_02_01_preview import models return models raise NotImplementedError("APIVersion {} is not available".format(api_version)) @@ -114,10 +114,10 @@ def models(cls, api_version=DEFAULT_API_VERSION): def build_steps(self): """Instance depends on the API version: - * 2018-02-01-preview: :class:`BuildStepsOperations` + * 2017-10-01: :class:`BuildStepsOperations` """ api_version = self._get_api_version('build_steps') - if api_version == '2018-02-01-preview': + if api_version == '2017-10-01': from .v2018_02_01_preview.operations import BuildStepsOperations as OperationClass else: raise NotImplementedError("APIVersion {} is not available".format(api_version)) @@ -127,10 +127,10 @@ def build_steps(self): def build_tasks(self): """Instance depends on the API version: - * 2018-02-01-preview: :class:`BuildTasksOperations` + * 2017-10-01: :class:`BuildTasksOperations` """ api_version = self._get_api_version('build_tasks') - if api_version == '2018-02-01-preview': + if api_version == '2017-10-01': from .v2018_02_01_preview.operations import BuildTasksOperations as OperationClass else: raise NotImplementedError("APIVersion {} is not available".format(api_version)) @@ -140,10 +140,10 @@ def build_tasks(self): def builds(self): """Instance depends on the API version: - * 2018-02-01-preview: :class:`BuildsOperations` + * 2017-10-01: :class:`BuildsOperations` """ api_version = self._get_api_version('builds') - if api_version == '2018-02-01-preview': + if api_version == '2017-10-01': from .v2018_02_01_preview.operations import BuildsOperations as OperationClass else: raise NotImplementedError("APIVersion {} is not available".format(api_version)) @@ -155,14 +155,14 @@ def operations(self): * 2017-03-01: :class:`Operations` * 2017-10-01: :class:`Operations` - * 2018-02-01-preview: :class:`Operations` + * 2017-10-01: :class:`Operations` """ api_version = self._get_api_version('operations') if api_version == '2017-03-01': from .v2017_03_01.operations import Operations as OperationClass elif api_version == '2017-10-01': from .v2017_10_01.operations import Operations as OperationClass - elif api_version == '2018-02-01-preview': + elif api_version == '2017-10-01': from .v2018_02_01_preview.operations import Operations as OperationClass else: raise NotImplementedError("APIVersion {} is not available".format(api_version)) @@ -174,14 +174,14 @@ def registries(self): * 2017-03-01: :class:`RegistriesOperations` * 2017-10-01: :class:`RegistriesOperations` - * 2018-02-01-preview: :class:`RegistriesOperations` + * 2017-10-01: :class:`RegistriesOperations` """ api_version = self._get_api_version('registries') if api_version == '2017-03-01': from .v2017_03_01.operations import RegistriesOperations as OperationClass elif api_version == '2017-10-01': from .v2017_10_01.operations import RegistriesOperations as OperationClass - elif api_version == '2018-02-01-preview': + elif api_version == '2017-10-01': from .v2018_02_01_preview.operations import RegistriesOperations as OperationClass else: raise NotImplementedError("APIVersion {} is not available".format(api_version)) @@ -192,12 +192,12 @@ def replications(self): """Instance depends on the API version: * 2017-10-01: :class:`ReplicationsOperations` - * 2018-02-01-preview: :class:`ReplicationsOperations` + * 2017-10-01: :class:`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': + elif api_version == '2017-10-01': from .v2018_02_01_preview.operations import ReplicationsOperations as OperationClass else: raise NotImplementedError("APIVersion {} is not available".format(api_version)) @@ -208,12 +208,12 @@ def webhooks(self): """Instance depends on the API version: * 2017-10-01: :class:`WebhooksOperations` - * 2018-02-01-preview: :class:`WebhooksOperations` + * 2017-10-01: :class:`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': + elif api_version == '2017-10-01': from .v2018_02_01_preview.operations import WebhooksOperations as OperationClass else: raise NotImplementedError("APIVersion {} is not available".format(api_version)) diff --git a/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_03_01/models/registry_py3.py b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_03_01/models/registry_py3.py index d7bff8b5bbae..ba79fa81afd7 100644 --- a/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_03_01/models/registry_py3.py +++ b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_03_01/models/registry_py3.py @@ -9,7 +9,7 @@ # regenerated. # -------------------------------------------------------------------------- -from .resource import Resource +from .resource_py3 import Resource class Registry(Resource): diff --git a/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/__init__.py b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/__init__.py index 5adc95ceb66e..7eb9b6b270dd 100644 --- a/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/__init__.py +++ b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/__init__.py @@ -15,6 +15,8 @@ from .registry_name_check_request_py3 import RegistryNameCheckRequest from .registry_name_status_py3 import RegistryNameStatus from .operation_display_definition_py3 import OperationDisplayDefinition + from .operation_metric_specification_definition_py3 import OperationMetricSpecificationDefinition + from .operation_service_specification_definition_py3 import OperationServiceSpecificationDefinition from .operation_definition_py3 import OperationDefinition from .sku_py3 import Sku from .status_py3 import Status @@ -26,6 +28,9 @@ from .regenerate_credential_parameters_py3 import RegenerateCredentialParameters from .registry_usage_py3 import RegistryUsage from .registry_usage_list_result_py3 import RegistryUsageListResult + from .quarantine_policy_py3 import QuarantinePolicy + from .trust_policy_py3 import TrustPolicy + from .registry_policies_py3 import RegistryPolicies from .replication_py3 import Replication from .replication_update_parameters_py3 import ReplicationUpdateParameters from .webhook_py3 import Webhook @@ -48,6 +53,8 @@ from .registry_name_check_request import RegistryNameCheckRequest from .registry_name_status import RegistryNameStatus from .operation_display_definition import OperationDisplayDefinition + from .operation_metric_specification_definition import OperationMetricSpecificationDefinition + from .operation_service_specification_definition import OperationServiceSpecificationDefinition from .operation_definition import OperationDefinition from .sku import Sku from .status import Status @@ -59,6 +66,9 @@ from .regenerate_credential_parameters import RegenerateCredentialParameters from .registry_usage import RegistryUsage from .registry_usage_list_result import RegistryUsageListResult + from .quarantine_policy import QuarantinePolicy + from .trust_policy import TrustPolicy + from .registry_policies import RegistryPolicies from .replication import Replication from .replication_update_parameters import ReplicationUpdateParameters from .webhook import Webhook @@ -87,6 +97,8 @@ ProvisioningState, PasswordName, RegistryUsageUnit, + PolicyStatus, + TrustPolicyType, WebhookStatus, WebhookAction, ) @@ -97,6 +109,8 @@ 'RegistryNameCheckRequest', 'RegistryNameStatus', 'OperationDisplayDefinition', + 'OperationMetricSpecificationDefinition', + 'OperationServiceSpecificationDefinition', 'OperationDefinition', 'Sku', 'Status', @@ -108,6 +122,9 @@ 'RegenerateCredentialParameters', 'RegistryUsage', 'RegistryUsageListResult', + 'QuarantinePolicy', + 'TrustPolicy', + 'RegistryPolicies', 'Replication', 'ReplicationUpdateParameters', 'Webhook', @@ -135,6 +152,8 @@ 'ProvisioningState', 'PasswordName', 'RegistryUsageUnit', + 'PolicyStatus', + 'TrustPolicyType', 'WebhookStatus', 'WebhookAction', ] diff --git a/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/container_registry_management_client_enums.py b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/container_registry_management_client_enums.py index 0e52d1f418a0..cb15336b81f1 100644 --- a/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/container_registry_management_client_enums.py +++ b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/container_registry_management_client_enums.py @@ -56,6 +56,17 @@ class RegistryUsageUnit(str, Enum): bytes = "Bytes" +class PolicyStatus(str, Enum): + + enabled = "enabled" + disabled = "disabled" + + +class TrustPolicyType(str, Enum): + + notary = "Notary" + + class WebhookStatus(str, Enum): enabled = "enabled" @@ -66,3 +77,4 @@ class WebhookAction(str, Enum): push = "push" delete = "delete" + quarantine = "quarantine" diff --git a/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/event_py3.py b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/event_py3.py index d4a92a7e607a..852342efcd4b 100644 --- a/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/event_py3.py +++ b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/event_py3.py @@ -9,7 +9,7 @@ # regenerated. # -------------------------------------------------------------------------- -from .event_info import EventInfo +from .event_info_py3 import EventInfo class Event(EventInfo): diff --git a/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/operation_definition.py b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/operation_definition.py index 3e39fc31b640..c6a3a7eb8ffe 100644 --- a/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/operation_definition.py +++ b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/operation_definition.py @@ -15,20 +15,29 @@ class OperationDefinition(Model): """The definition of a container registry operation. + :param origin: The origin information of the container registry operation. + :type origin: str :param name: Operation name: {provider}/{resource}/{operation}. :type name: str :param display: The display information for the container registry operation. :type display: ~azure.mgmt.containerregistry.v2017_10_01.models.OperationDisplayDefinition + :param service_specification: The definition of Azure Monitoring service. + :type service_specification: + ~azure.mgmt.containerregistry.v2017_10_01.models.OperationServiceSpecificationDefinition """ _attribute_map = { + 'origin': {'key': 'origin', 'type': 'str'}, 'name': {'key': 'name', 'type': 'str'}, 'display': {'key': 'display', 'type': 'OperationDisplayDefinition'}, + 'service_specification': {'key': 'properties.serviceSpecification', 'type': 'OperationServiceSpecificationDefinition'}, } def __init__(self, **kwargs): super(OperationDefinition, self).__init__(**kwargs) + self.origin = kwargs.get('origin', None) self.name = kwargs.get('name', None) self.display = kwargs.get('display', None) + self.service_specification = kwargs.get('service_specification', None) diff --git a/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/operation_definition_py3.py b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/operation_definition_py3.py index 21bf5937c2e7..9dcc5c41ab11 100644 --- a/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/operation_definition_py3.py +++ b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/operation_definition_py3.py @@ -15,20 +15,29 @@ class OperationDefinition(Model): """The definition of a container registry operation. + :param origin: The origin information of the container registry operation. + :type origin: str :param name: Operation name: {provider}/{resource}/{operation}. :type name: str :param display: The display information for the container registry operation. :type display: ~azure.mgmt.containerregistry.v2017_10_01.models.OperationDisplayDefinition + :param service_specification: The definition of Azure Monitoring service. + :type service_specification: + ~azure.mgmt.containerregistry.v2017_10_01.models.OperationServiceSpecificationDefinition """ _attribute_map = { + 'origin': {'key': 'origin', 'type': 'str'}, 'name': {'key': 'name', 'type': 'str'}, 'display': {'key': 'display', 'type': 'OperationDisplayDefinition'}, + 'service_specification': {'key': 'properties.serviceSpecification', 'type': 'OperationServiceSpecificationDefinition'}, } - def __init__(self, *, name: str=None, display=None, **kwargs) -> None: + def __init__(self, *, origin: str=None, name: str=None, display=None, service_specification=None, **kwargs) -> None: super(OperationDefinition, self).__init__(**kwargs) + self.origin = origin self.name = name self.display = display + self.service_specification = service_specification diff --git a/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/operation_metric_specification_definition.py b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/operation_metric_specification_definition.py new file mode 100644 index 000000000000..8b40b3b4d6f1 --- /dev/null +++ b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/operation_metric_specification_definition.py @@ -0,0 +1,48 @@ +# 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 OperationMetricSpecificationDefinition(Model): + """The definition of Azure Monitoring metric. + + :param name: Metric name. + :type name: str + :param display_name: Metric display name. + :type display_name: str + :param display_description: Metric description. + :type display_description: str + :param unit: Metric unit. + :type unit: str + :param aggregation_type: Metric aggregation type. + :type aggregation_type: str + :param internal_metric_name: Internal metric name. + :type internal_metric_name: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'display_name': {'key': 'displayName', 'type': 'str'}, + 'display_description': {'key': 'displayDescription', 'type': 'str'}, + 'unit': {'key': 'unit', 'type': 'str'}, + 'aggregation_type': {'key': 'aggregationType', 'type': 'str'}, + 'internal_metric_name': {'key': 'internalMetricName', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(OperationMetricSpecificationDefinition, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.display_name = kwargs.get('display_name', None) + self.display_description = kwargs.get('display_description', None) + self.unit = kwargs.get('unit', None) + self.aggregation_type = kwargs.get('aggregation_type', None) + self.internal_metric_name = kwargs.get('internal_metric_name', None) diff --git a/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/operation_metric_specification_definition_py3.py b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/operation_metric_specification_definition_py3.py new file mode 100644 index 000000000000..db4f31c14a17 --- /dev/null +++ b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/operation_metric_specification_definition_py3.py @@ -0,0 +1,48 @@ +# 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 OperationMetricSpecificationDefinition(Model): + """The definition of Azure Monitoring metric. + + :param name: Metric name. + :type name: str + :param display_name: Metric display name. + :type display_name: str + :param display_description: Metric description. + :type display_description: str + :param unit: Metric unit. + :type unit: str + :param aggregation_type: Metric aggregation type. + :type aggregation_type: str + :param internal_metric_name: Internal metric name. + :type internal_metric_name: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'display_name': {'key': 'displayName', 'type': 'str'}, + 'display_description': {'key': 'displayDescription', 'type': 'str'}, + 'unit': {'key': 'unit', 'type': 'str'}, + 'aggregation_type': {'key': 'aggregationType', 'type': 'str'}, + 'internal_metric_name': {'key': 'internalMetricName', 'type': 'str'}, + } + + def __init__(self, *, name: str=None, display_name: str=None, display_description: str=None, unit: str=None, aggregation_type: str=None, internal_metric_name: str=None, **kwargs) -> None: + super(OperationMetricSpecificationDefinition, self).__init__(**kwargs) + self.name = name + self.display_name = display_name + self.display_description = display_description + self.unit = unit + self.aggregation_type = aggregation_type + self.internal_metric_name = internal_metric_name diff --git a/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/operation_service_specification_definition.py b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/operation_service_specification_definition.py new file mode 100644 index 000000000000..a7d9b567970c --- /dev/null +++ b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/operation_service_specification_definition.py @@ -0,0 +1,30 @@ +# 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 OperationServiceSpecificationDefinition(Model): + """The definition of Azure Monitoring metrics list. + + :param metric_specifications: A list of Azure Monitoring metrics + definition. + :type metric_specifications: + list[~azure.mgmt.containerregistry.v2017_10_01.models.OperationMetricSpecificationDefinition] + """ + + _attribute_map = { + 'metric_specifications': {'key': 'metricSpecifications', 'type': '[OperationMetricSpecificationDefinition]'}, + } + + def __init__(self, **kwargs): + super(OperationServiceSpecificationDefinition, self).__init__(**kwargs) + self.metric_specifications = kwargs.get('metric_specifications', None) diff --git a/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/operation_service_specification_definition_py3.py b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/operation_service_specification_definition_py3.py new file mode 100644 index 000000000000..4244eadaed6f --- /dev/null +++ b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/operation_service_specification_definition_py3.py @@ -0,0 +1,30 @@ +# 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 OperationServiceSpecificationDefinition(Model): + """The definition of Azure Monitoring metrics list. + + :param metric_specifications: A list of Azure Monitoring metrics + definition. + :type metric_specifications: + list[~azure.mgmt.containerregistry.v2017_10_01.models.OperationMetricSpecificationDefinition] + """ + + _attribute_map = { + 'metric_specifications': {'key': 'metricSpecifications', 'type': '[OperationMetricSpecificationDefinition]'}, + } + + def __init__(self, *, metric_specifications=None, **kwargs) -> None: + super(OperationServiceSpecificationDefinition, self).__init__(**kwargs) + self.metric_specifications = metric_specifications diff --git a/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/quarantine_policy.py b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/quarantine_policy.py new file mode 100644 index 000000000000..005993e2025d --- /dev/null +++ b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/quarantine_policy.py @@ -0,0 +1,30 @@ +# 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 QuarantinePolicy(Model): + """An object that represents quarantine policy for a container registry. + + :param status: The value that indicates whether the policy is enabled or + not. Possible values include: 'enabled', 'disabled' + :type status: str or + ~azure.mgmt.containerregistry.v2017_10_01.models.PolicyStatus + """ + + _attribute_map = { + 'status': {'key': 'status', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(QuarantinePolicy, self).__init__(**kwargs) + self.status = kwargs.get('status', None) diff --git a/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/quarantine_policy_py3.py b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/quarantine_policy_py3.py new file mode 100644 index 000000000000..3a8ab60d0aa1 --- /dev/null +++ b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/quarantine_policy_py3.py @@ -0,0 +1,30 @@ +# 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 QuarantinePolicy(Model): + """An object that represents quarantine policy for a container registry. + + :param status: The value that indicates whether the policy is enabled or + not. Possible values include: 'enabled', 'disabled' + :type status: str or + ~azure.mgmt.containerregistry.v2017_10_01.models.PolicyStatus + """ + + _attribute_map = { + 'status': {'key': 'status', 'type': 'str'}, + } + + def __init__(self, *, status=None, **kwargs) -> None: + super(QuarantinePolicy, self).__init__(**kwargs) + self.status = status diff --git a/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/registry_policies.py b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/registry_policies.py new file mode 100644 index 000000000000..5fb9da276d8b --- /dev/null +++ b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/registry_policies.py @@ -0,0 +1,36 @@ +# 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 RegistryPolicies(Model): + """An object that represents policies for a container registry. + + :param quarantine_policy: An object that represents quarantine policy for + a container registry. + :type quarantine_policy: + ~azure.mgmt.containerregistry.v2017_10_01.models.QuarantinePolicy + :param trust_policy: An object that represents content trust policy for a + container registry. + :type trust_policy: + ~azure.mgmt.containerregistry.v2017_10_01.models.TrustPolicy + """ + + _attribute_map = { + 'quarantine_policy': {'key': 'quarantinePolicy', 'type': 'QuarantinePolicy'}, + 'trust_policy': {'key': 'trustPolicy', 'type': 'TrustPolicy'}, + } + + def __init__(self, **kwargs): + super(RegistryPolicies, self).__init__(**kwargs) + self.quarantine_policy = kwargs.get('quarantine_policy', None) + self.trust_policy = kwargs.get('trust_policy', None) diff --git a/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/registry_policies_py3.py b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/registry_policies_py3.py new file mode 100644 index 000000000000..478414895fc8 --- /dev/null +++ b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/registry_policies_py3.py @@ -0,0 +1,36 @@ +# 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 RegistryPolicies(Model): + """An object that represents policies for a container registry. + + :param quarantine_policy: An object that represents quarantine policy for + a container registry. + :type quarantine_policy: + ~azure.mgmt.containerregistry.v2017_10_01.models.QuarantinePolicy + :param trust_policy: An object that represents content trust policy for a + container registry. + :type trust_policy: + ~azure.mgmt.containerregistry.v2017_10_01.models.TrustPolicy + """ + + _attribute_map = { + 'quarantine_policy': {'key': 'quarantinePolicy', 'type': 'QuarantinePolicy'}, + 'trust_policy': {'key': 'trustPolicy', 'type': 'TrustPolicy'}, + } + + def __init__(self, *, quarantine_policy=None, trust_policy=None, **kwargs) -> None: + super(RegistryPolicies, self).__init__(**kwargs) + self.quarantine_policy = quarantine_policy + self.trust_policy = trust_policy diff --git a/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/registry_py3.py b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/registry_py3.py index 1508c03a9225..0ab8610f20b5 100644 --- a/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/registry_py3.py +++ b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/registry_py3.py @@ -9,7 +9,7 @@ # regenerated. # -------------------------------------------------------------------------- -from .resource import Resource +from .resource_py3 import Resource class Registry(Resource): diff --git a/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/replication_py3.py b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/replication_py3.py index 045582df115c..7024913b8b59 100644 --- a/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/replication_py3.py +++ b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/replication_py3.py @@ -9,7 +9,7 @@ # regenerated. # -------------------------------------------------------------------------- -from .resource import Resource +from .resource_py3 import Resource class Replication(Resource): diff --git a/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/trust_policy.py b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/trust_policy.py new file mode 100644 index 000000000000..f01b9e4e6560 --- /dev/null +++ b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/trust_policy.py @@ -0,0 +1,35 @@ +# 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 TrustPolicy(Model): + """An object that represents content trust policy for a container registry. + + :param type: The type of trust policy. Possible values include: 'Notary' + :type type: str or + ~azure.mgmt.containerregistry.v2017_10_01.models.TrustPolicyType + :param status: The value that indicates whether the policy is enabled or + not. Possible values include: 'enabled', 'disabled' + :type status: str or + ~azure.mgmt.containerregistry.v2017_10_01.models.PolicyStatus + """ + + _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, + 'status': {'key': 'status', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(TrustPolicy, self).__init__(**kwargs) + self.type = kwargs.get('type', None) + self.status = kwargs.get('status', None) diff --git a/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/trust_policy_py3.py b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/trust_policy_py3.py new file mode 100644 index 000000000000..0ecc57d83c51 --- /dev/null +++ b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/trust_policy_py3.py @@ -0,0 +1,35 @@ +# 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 TrustPolicy(Model): + """An object that represents content trust policy for a container registry. + + :param type: The type of trust policy. Possible values include: 'Notary' + :type type: str or + ~azure.mgmt.containerregistry.v2017_10_01.models.TrustPolicyType + :param status: The value that indicates whether the policy is enabled or + not. Possible values include: 'enabled', 'disabled' + :type status: str or + ~azure.mgmt.containerregistry.v2017_10_01.models.PolicyStatus + """ + + _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, + 'status': {'key': 'status', 'type': 'str'}, + } + + def __init__(self, *, type=None, status=None, **kwargs) -> None: + super(TrustPolicy, self).__init__(**kwargs) + self.type = type + self.status = status diff --git a/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/webhook_py3.py b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/webhook_py3.py index cde2a32a8c43..db1f752a8b3b 100644 --- a/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/webhook_py3.py +++ b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/models/webhook_py3.py @@ -9,7 +9,7 @@ # regenerated. # -------------------------------------------------------------------------- -from .resource import Resource +from .resource_py3 import Resource class Webhook(Resource): diff --git a/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/operations/registries_operations.py b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/operations/registries_operations.py index baf35b38ec5c..b5a5e7b2dde2 100644 --- a/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/operations/registries_operations.py +++ b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/operations/registries_operations.py @@ -889,3 +889,177 @@ def list_usages( return deserialized list_usages.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/listUsages'} + + def list_policies( + self, resource_group_name, registry_name, custom_headers=None, raw=False, **operation_config): + """Lists the policies for the 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: RegistryPolicies or ClientRawResponse if raw=true + :rtype: + ~azure.mgmt.containerregistry.v2017_10_01.models.RegistryPolicies or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.list_policies.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'), + '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') + + # 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: + 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) + response = self._client.send(request, header_parameters, 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 + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('RegistryPolicies', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + list_policies.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/listPolicies'} + + + def _update_policies_initial( + self, resource_group_name, registry_name, quarantine_policy=None, trust_policy=None, custom_headers=None, raw=False, **operation_config): + registry_policies_update_parameters = models.RegistryPolicies(quarantine_policy=quarantine_policy, trust_policy=trust_policy) + + # Construct URL + url = self.update_policies.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'), + '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') + + # 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: + 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(registry_policies_update_parameters, 'RegistryPolicies') + + # Construct and send request + request = self._client.post(url, query_parameters) + response = self._client.send( + request, header_parameters, body_content, 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 + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('RegistryPolicies', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def update_policies( + self, resource_group_name, registry_name, quarantine_policy=None, trust_policy=None, custom_headers=None, raw=False, polling=True, **operation_config): + """Updates the policies for the 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 quarantine_policy: An object that represents quarantine policy + for a container registry. + :type quarantine_policy: + ~azure.mgmt.containerregistry.v2017_10_01.models.QuarantinePolicy + :param trust_policy: An object that represents content trust policy + for a container registry. + :type trust_policy: + ~azure.mgmt.containerregistry.v2017_10_01.models.TrustPolicy + :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 RegistryPolicies or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.containerregistry.v2017_10_01.models.RegistryPolicies] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.containerregistry.v2017_10_01.models.RegistryPolicies]] + :raises: :class:`CloudError` + """ + raw_result = self._update_policies_initial( + resource_group_name=resource_group_name, + registry_name=registry_name, + quarantine_policy=quarantine_policy, + trust_policy=trust_policy, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('RegistryPolicies', 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_policies.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/updatePolicies'} diff --git a/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/__init__.py b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/__init__.py index a1b9a4403970..fb6da3f656de 100644 --- a/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/__init__.py +++ b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/__init__.py @@ -15,6 +15,8 @@ from .registry_name_check_request_py3 import RegistryNameCheckRequest from .registry_name_status_py3 import RegistryNameStatus from .operation_display_definition_py3 import OperationDisplayDefinition + from .operation_metric_specification_definition_py3 import OperationMetricSpecificationDefinition + from .operation_service_specification_definition_py3 import OperationServiceSpecificationDefinition from .operation_definition_py3 import OperationDefinition from .sku_py3 import Sku from .status_py3 import Status @@ -26,6 +28,9 @@ from .regenerate_credential_parameters_py3 import RegenerateCredentialParameters from .registry_usage_py3 import RegistryUsage from .registry_usage_list_result_py3 import RegistryUsageListResult + from .quarantine_policy_py3 import QuarantinePolicy + from .trust_policy_py3 import TrustPolicy + from .registry_policies_py3 import RegistryPolicies from .replication_py3 import Replication from .replication_update_parameters_py3 import ReplicationUpdateParameters from .webhook_py3 import Webhook @@ -75,6 +80,8 @@ from .registry_name_check_request import RegistryNameCheckRequest from .registry_name_status import RegistryNameStatus from .operation_display_definition import OperationDisplayDefinition + from .operation_metric_specification_definition import OperationMetricSpecificationDefinition + from .operation_service_specification_definition import OperationServiceSpecificationDefinition from .operation_definition import OperationDefinition from .sku import Sku from .status import Status @@ -86,6 +93,9 @@ from .regenerate_credential_parameters import RegenerateCredentialParameters from .registry_usage import RegistryUsage from .registry_usage_list_result import RegistryUsageListResult + from .quarantine_policy import QuarantinePolicy + from .trust_policy import TrustPolicy + from .registry_policies import RegistryPolicies from .replication import Replication from .replication_update_parameters import ReplicationUpdateParameters from .webhook import Webhook @@ -145,6 +155,8 @@ ProvisioningState, PasswordName, RegistryUsageUnit, + PolicyStatus, + TrustPolicyType, WebhookStatus, WebhookAction, BuildStatus, @@ -163,6 +175,8 @@ 'RegistryNameCheckRequest', 'RegistryNameStatus', 'OperationDisplayDefinition', + 'OperationMetricSpecificationDefinition', + 'OperationServiceSpecificationDefinition', 'OperationDefinition', 'Sku', 'Status', @@ -174,6 +188,9 @@ 'RegenerateCredentialParameters', 'RegistryUsage', 'RegistryUsageListResult', + 'QuarantinePolicy', + 'TrustPolicy', + 'RegistryPolicies', 'Replication', 'ReplicationUpdateParameters', 'Webhook', @@ -232,6 +249,8 @@ 'ProvisioningState', 'PasswordName', 'RegistryUsageUnit', + 'PolicyStatus', + 'TrustPolicyType', 'WebhookStatus', 'WebhookAction', 'BuildStatus', diff --git a/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/build_py3.py b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/build_py3.py index 1b69511e16d0..3e1446db21db 100644 --- a/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/build_py3.py +++ b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/build_py3.py @@ -9,7 +9,7 @@ # regenerated. # -------------------------------------------------------------------------- -from .proxy_resource import ProxyResource +from .proxy_resource_py3 import ProxyResource class Build(ProxyResource): diff --git a/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/build_step_py3.py b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/build_step_py3.py index de3af6351f11..14dad4ba32bd 100644 --- a/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/build_step_py3.py +++ b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/build_step_py3.py @@ -9,7 +9,7 @@ # regenerated. # -------------------------------------------------------------------------- -from .proxy_resource import ProxyResource +from .proxy_resource_py3 import ProxyResource class BuildStep(ProxyResource): diff --git a/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/build_task_build_request_py3.py b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/build_task_build_request_py3.py index a22d16561ea7..e79235f4c786 100644 --- a/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/build_task_build_request_py3.py +++ b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/build_task_build_request_py3.py @@ -9,7 +9,7 @@ # regenerated. # -------------------------------------------------------------------------- -from .queue_build_request import QueueBuildRequest +from .queue_build_request_py3 import QueueBuildRequest class BuildTaskBuildRequest(QueueBuildRequest): diff --git a/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/build_task_py3.py b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/build_task_py3.py index 301f704f985d..4b14557445c8 100644 --- a/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/build_task_py3.py +++ b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/build_task_py3.py @@ -9,7 +9,7 @@ # regenerated. # -------------------------------------------------------------------------- -from .resource import Resource +from .resource_py3 import Resource class BuildTask(Resource): diff --git a/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/container_registry_management_client_enums.py b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/container_registry_management_client_enums.py index c29d5565f7b4..7e8a358ecd2c 100644 --- a/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/container_registry_management_client_enums.py +++ b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/container_registry_management_client_enums.py @@ -56,6 +56,17 @@ class RegistryUsageUnit(str, Enum): bytes = "Bytes" +class PolicyStatus(str, Enum): + + enabled = "enabled" + disabled = "disabled" + + +class TrustPolicyType(str, Enum): + + notary = "Notary" + + class WebhookStatus(str, Enum): enabled = "enabled" @@ -66,6 +77,7 @@ class WebhookAction(str, Enum): push = "push" delete = "delete" + quarantine = "quarantine" class BuildStatus(str, Enum): diff --git a/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/docker_build_step_py3.py b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/docker_build_step_py3.py index eb21648af215..70ffd18dd40d 100644 --- a/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/docker_build_step_py3.py +++ b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/docker_build_step_py3.py @@ -9,7 +9,7 @@ # regenerated. # -------------------------------------------------------------------------- -from .build_step_properties import BuildStepProperties +from .build_step_properties_py3 import BuildStepProperties class DockerBuildStep(BuildStepProperties): diff --git a/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/docker_build_step_update_parameters_py3.py b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/docker_build_step_update_parameters_py3.py index 6a300c65d6cf..e76239889858 100644 --- a/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/docker_build_step_update_parameters_py3.py +++ b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/docker_build_step_update_parameters_py3.py @@ -9,7 +9,7 @@ # regenerated. # -------------------------------------------------------------------------- -from .build_step_properties_update_parameters import BuildStepPropertiesUpdateParameters +from .build_step_properties_update_parameters_py3 import BuildStepPropertiesUpdateParameters class DockerBuildStepUpdateParameters(BuildStepPropertiesUpdateParameters): diff --git a/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/event_py3.py b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/event_py3.py index 2c09cd73fd97..573ab944ce34 100644 --- a/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/event_py3.py +++ b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/event_py3.py @@ -9,7 +9,7 @@ # regenerated. # -------------------------------------------------------------------------- -from .event_info import EventInfo +from .event_info_py3 import EventInfo class Event(EventInfo): diff --git a/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/operation_definition.py b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/operation_definition.py index cda8d8152245..0b89560afaf1 100644 --- a/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/operation_definition.py +++ b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/operation_definition.py @@ -15,20 +15,29 @@ class OperationDefinition(Model): """The definition of a container registry operation. + :param origin: The origin information of the container registry operation. + :type origin: str :param name: Operation name: {provider}/{resource}/{operation}. :type name: str :param display: The display information for the container registry operation. :type display: ~azure.mgmt.containerregistry.v2018_02_01_preview.models.OperationDisplayDefinition + :param service_specification: The definition of Azure Monitoring service. + :type service_specification: + ~azure.mgmt.containerregistry.v2018_02_01_preview.models.OperationServiceSpecificationDefinition """ _attribute_map = { + 'origin': {'key': 'origin', 'type': 'str'}, 'name': {'key': 'name', 'type': 'str'}, 'display': {'key': 'display', 'type': 'OperationDisplayDefinition'}, + 'service_specification': {'key': 'properties.serviceSpecification', 'type': 'OperationServiceSpecificationDefinition'}, } def __init__(self, **kwargs): super(OperationDefinition, self).__init__(**kwargs) + self.origin = kwargs.get('origin', None) self.name = kwargs.get('name', None) self.display = kwargs.get('display', None) + self.service_specification = kwargs.get('service_specification', None) diff --git a/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/operation_definition_py3.py b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/operation_definition_py3.py index afab8bcf4c0d..61197df085c6 100644 --- a/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/operation_definition_py3.py +++ b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/operation_definition_py3.py @@ -15,20 +15,29 @@ class OperationDefinition(Model): """The definition of a container registry operation. + :param origin: The origin information of the container registry operation. + :type origin: str :param name: Operation name: {provider}/{resource}/{operation}. :type name: str :param display: The display information for the container registry operation. :type display: ~azure.mgmt.containerregistry.v2018_02_01_preview.models.OperationDisplayDefinition + :param service_specification: The definition of Azure Monitoring service. + :type service_specification: + ~azure.mgmt.containerregistry.v2018_02_01_preview.models.OperationServiceSpecificationDefinition """ _attribute_map = { + 'origin': {'key': 'origin', 'type': 'str'}, 'name': {'key': 'name', 'type': 'str'}, 'display': {'key': 'display', 'type': 'OperationDisplayDefinition'}, + 'service_specification': {'key': 'properties.serviceSpecification', 'type': 'OperationServiceSpecificationDefinition'}, } - def __init__(self, *, name: str=None, display=None, **kwargs) -> None: + def __init__(self, *, origin: str=None, name: str=None, display=None, service_specification=None, **kwargs) -> None: super(OperationDefinition, self).__init__(**kwargs) + self.origin = origin self.name = name self.display = display + self.service_specification = service_specification diff --git a/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/operation_metric_specification_definition.py b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/operation_metric_specification_definition.py new file mode 100644 index 000000000000..8b40b3b4d6f1 --- /dev/null +++ b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/operation_metric_specification_definition.py @@ -0,0 +1,48 @@ +# 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 OperationMetricSpecificationDefinition(Model): + """The definition of Azure Monitoring metric. + + :param name: Metric name. + :type name: str + :param display_name: Metric display name. + :type display_name: str + :param display_description: Metric description. + :type display_description: str + :param unit: Metric unit. + :type unit: str + :param aggregation_type: Metric aggregation type. + :type aggregation_type: str + :param internal_metric_name: Internal metric name. + :type internal_metric_name: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'display_name': {'key': 'displayName', 'type': 'str'}, + 'display_description': {'key': 'displayDescription', 'type': 'str'}, + 'unit': {'key': 'unit', 'type': 'str'}, + 'aggregation_type': {'key': 'aggregationType', 'type': 'str'}, + 'internal_metric_name': {'key': 'internalMetricName', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(OperationMetricSpecificationDefinition, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.display_name = kwargs.get('display_name', None) + self.display_description = kwargs.get('display_description', None) + self.unit = kwargs.get('unit', None) + self.aggregation_type = kwargs.get('aggregation_type', None) + self.internal_metric_name = kwargs.get('internal_metric_name', None) diff --git a/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/operation_metric_specification_definition_py3.py b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/operation_metric_specification_definition_py3.py new file mode 100644 index 000000000000..db4f31c14a17 --- /dev/null +++ b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/operation_metric_specification_definition_py3.py @@ -0,0 +1,48 @@ +# 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 OperationMetricSpecificationDefinition(Model): + """The definition of Azure Monitoring metric. + + :param name: Metric name. + :type name: str + :param display_name: Metric display name. + :type display_name: str + :param display_description: Metric description. + :type display_description: str + :param unit: Metric unit. + :type unit: str + :param aggregation_type: Metric aggregation type. + :type aggregation_type: str + :param internal_metric_name: Internal metric name. + :type internal_metric_name: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'display_name': {'key': 'displayName', 'type': 'str'}, + 'display_description': {'key': 'displayDescription', 'type': 'str'}, + 'unit': {'key': 'unit', 'type': 'str'}, + 'aggregation_type': {'key': 'aggregationType', 'type': 'str'}, + 'internal_metric_name': {'key': 'internalMetricName', 'type': 'str'}, + } + + def __init__(self, *, name: str=None, display_name: str=None, display_description: str=None, unit: str=None, aggregation_type: str=None, internal_metric_name: str=None, **kwargs) -> None: + super(OperationMetricSpecificationDefinition, self).__init__(**kwargs) + self.name = name + self.display_name = display_name + self.display_description = display_description + self.unit = unit + self.aggregation_type = aggregation_type + self.internal_metric_name = internal_metric_name diff --git a/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/operation_service_specification_definition.py b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/operation_service_specification_definition.py new file mode 100644 index 000000000000..7106aed46546 --- /dev/null +++ b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/operation_service_specification_definition.py @@ -0,0 +1,30 @@ +# 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 OperationServiceSpecificationDefinition(Model): + """The definition of Azure Monitoring metrics list. + + :param metric_specifications: A list of Azure Monitoring metrics + definition. + :type metric_specifications: + list[~azure.mgmt.containerregistry.v2018_02_01_preview.models.OperationMetricSpecificationDefinition] + """ + + _attribute_map = { + 'metric_specifications': {'key': 'metricSpecifications', 'type': '[OperationMetricSpecificationDefinition]'}, + } + + def __init__(self, **kwargs): + super(OperationServiceSpecificationDefinition, self).__init__(**kwargs) + self.metric_specifications = kwargs.get('metric_specifications', None) diff --git a/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/operation_service_specification_definition_py3.py b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/operation_service_specification_definition_py3.py new file mode 100644 index 000000000000..837b2fae6744 --- /dev/null +++ b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/operation_service_specification_definition_py3.py @@ -0,0 +1,30 @@ +# 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 OperationServiceSpecificationDefinition(Model): + """The definition of Azure Monitoring metrics list. + + :param metric_specifications: A list of Azure Monitoring metrics + definition. + :type metric_specifications: + list[~azure.mgmt.containerregistry.v2018_02_01_preview.models.OperationMetricSpecificationDefinition] + """ + + _attribute_map = { + 'metric_specifications': {'key': 'metricSpecifications', 'type': '[OperationMetricSpecificationDefinition]'}, + } + + def __init__(self, *, metric_specifications=None, **kwargs) -> None: + super(OperationServiceSpecificationDefinition, self).__init__(**kwargs) + self.metric_specifications = metric_specifications diff --git a/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/quarantine_policy.py b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/quarantine_policy.py new file mode 100644 index 000000000000..849f9dbd9d30 --- /dev/null +++ b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/quarantine_policy.py @@ -0,0 +1,30 @@ +# 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 QuarantinePolicy(Model): + """An object that represents quarantine policy for a container registry. + + :param status: The value that indicates whether the policy is enabled or + not. Possible values include: 'enabled', 'disabled' + :type status: str or + ~azure.mgmt.containerregistry.v2018_02_01_preview.models.PolicyStatus + """ + + _attribute_map = { + 'status': {'key': 'status', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(QuarantinePolicy, self).__init__(**kwargs) + self.status = kwargs.get('status', None) diff --git a/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/quarantine_policy_py3.py b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/quarantine_policy_py3.py new file mode 100644 index 000000000000..9ab841c07043 --- /dev/null +++ b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/quarantine_policy_py3.py @@ -0,0 +1,30 @@ +# 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 QuarantinePolicy(Model): + """An object that represents quarantine policy for a container registry. + + :param status: The value that indicates whether the policy is enabled or + not. Possible values include: 'enabled', 'disabled' + :type status: str or + ~azure.mgmt.containerregistry.v2018_02_01_preview.models.PolicyStatus + """ + + _attribute_map = { + 'status': {'key': 'status', 'type': 'str'}, + } + + def __init__(self, *, status=None, **kwargs) -> None: + super(QuarantinePolicy, self).__init__(**kwargs) + self.status = status diff --git a/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/quick_build_request_py3.py b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/quick_build_request_py3.py index 9678b6d80a05..bad180488cd6 100644 --- a/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/quick_build_request_py3.py +++ b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/quick_build_request_py3.py @@ -9,7 +9,7 @@ # regenerated. # -------------------------------------------------------------------------- -from .queue_build_request import QueueBuildRequest +from .queue_build_request_py3 import QueueBuildRequest class QuickBuildRequest(QueueBuildRequest): diff --git a/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/registry_policies.py b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/registry_policies.py new file mode 100644 index 000000000000..4a7f2fcc64e4 --- /dev/null +++ b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/registry_policies.py @@ -0,0 +1,36 @@ +# 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 RegistryPolicies(Model): + """An object that represents policies for a container registry. + + :param quarantine_policy: An object that represents quarantine policy for + a container registry. + :type quarantine_policy: + ~azure.mgmt.containerregistry.v2018_02_01_preview.models.QuarantinePolicy + :param trust_policy: An object that represents content trust policy for a + container registry. + :type trust_policy: + ~azure.mgmt.containerregistry.v2018_02_01_preview.models.TrustPolicy + """ + + _attribute_map = { + 'quarantine_policy': {'key': 'quarantinePolicy', 'type': 'QuarantinePolicy'}, + 'trust_policy': {'key': 'trustPolicy', 'type': 'TrustPolicy'}, + } + + def __init__(self, **kwargs): + super(RegistryPolicies, self).__init__(**kwargs) + self.quarantine_policy = kwargs.get('quarantine_policy', None) + self.trust_policy = kwargs.get('trust_policy', None) diff --git a/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/registry_policies_py3.py b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/registry_policies_py3.py new file mode 100644 index 000000000000..f14e2458b8f6 --- /dev/null +++ b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/registry_policies_py3.py @@ -0,0 +1,36 @@ +# 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 RegistryPolicies(Model): + """An object that represents policies for a container registry. + + :param quarantine_policy: An object that represents quarantine policy for + a container registry. + :type quarantine_policy: + ~azure.mgmt.containerregistry.v2018_02_01_preview.models.QuarantinePolicy + :param trust_policy: An object that represents content trust policy for a + container registry. + :type trust_policy: + ~azure.mgmt.containerregistry.v2018_02_01_preview.models.TrustPolicy + """ + + _attribute_map = { + 'quarantine_policy': {'key': 'quarantinePolicy', 'type': 'QuarantinePolicy'}, + 'trust_policy': {'key': 'trustPolicy', 'type': 'TrustPolicy'}, + } + + def __init__(self, *, quarantine_policy=None, trust_policy=None, **kwargs) -> None: + super(RegistryPolicies, self).__init__(**kwargs) + self.quarantine_policy = quarantine_policy + self.trust_policy = trust_policy diff --git a/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/registry_py3.py b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/registry_py3.py index 4f7ac193cac8..751889cd8cac 100644 --- a/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/registry_py3.py +++ b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/registry_py3.py @@ -9,7 +9,7 @@ # regenerated. # -------------------------------------------------------------------------- -from .resource import Resource +from .resource_py3 import Resource class Registry(Resource): diff --git a/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/replication_py3.py b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/replication_py3.py index d58d9fefecd1..b89d4ab0156f 100644 --- a/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/replication_py3.py +++ b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/replication_py3.py @@ -9,7 +9,7 @@ # regenerated. # -------------------------------------------------------------------------- -from .resource import Resource +from .resource_py3 import Resource class Replication(Resource): diff --git a/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/trust_policy.py b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/trust_policy.py new file mode 100644 index 000000000000..267ccc70b989 --- /dev/null +++ b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/trust_policy.py @@ -0,0 +1,35 @@ +# 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 TrustPolicy(Model): + """An object that represents content trust policy for a container registry. + + :param type: The type of trust policy. Possible values include: 'Notary' + :type type: str or + ~azure.mgmt.containerregistry.v2018_02_01_preview.models.TrustPolicyType + :param status: The value that indicates whether the policy is enabled or + not. Possible values include: 'enabled', 'disabled' + :type status: str or + ~azure.mgmt.containerregistry.v2018_02_01_preview.models.PolicyStatus + """ + + _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, + 'status': {'key': 'status', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(TrustPolicy, self).__init__(**kwargs) + self.type = kwargs.get('type', None) + self.status = kwargs.get('status', None) diff --git a/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/trust_policy_py3.py b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/trust_policy_py3.py new file mode 100644 index 000000000000..4c70cb0041a6 --- /dev/null +++ b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/trust_policy_py3.py @@ -0,0 +1,35 @@ +# 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 TrustPolicy(Model): + """An object that represents content trust policy for a container registry. + + :param type: The type of trust policy. Possible values include: 'Notary' + :type type: str or + ~azure.mgmt.containerregistry.v2018_02_01_preview.models.TrustPolicyType + :param status: The value that indicates whether the policy is enabled or + not. Possible values include: 'enabled', 'disabled' + :type status: str or + ~azure.mgmt.containerregistry.v2018_02_01_preview.models.PolicyStatus + """ + + _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, + 'status': {'key': 'status', 'type': 'str'}, + } + + def __init__(self, *, type=None, status=None, **kwargs) -> None: + super(TrustPolicy, self).__init__(**kwargs) + self.type = type + self.status = status diff --git a/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/webhook_py3.py b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/webhook_py3.py index 91a644e553c6..16f73cb7811d 100644 --- a/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/webhook_py3.py +++ b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/models/webhook_py3.py @@ -9,7 +9,7 @@ # regenerated. # -------------------------------------------------------------------------- -from .resource import Resource +from .resource_py3 import Resource class Webhook(Resource): diff --git a/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/operations/registries_operations.py b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/operations/registries_operations.py index 005d7b5a205c..c7a73f8e0c2c 100644 --- a/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/operations/registries_operations.py +++ b/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2018_02_01_preview/operations/registries_operations.py @@ -911,6 +911,184 @@ def list_usages( return deserialized list_usages.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/listUsages'} + def list_policies( + self, resource_group_name, registry_name, custom_headers=None, raw=False, **operation_config): + """Lists the policies for the 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: RegistryPolicies or ClientRawResponse if raw=true + :rtype: + ~azure.mgmt.containerregistry.v2018_02_01_preview.models.RegistryPolicies + or ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + api_version = "2017-10-01" + + # Construct URL + url = self.list_policies.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'), + '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("api_version", api_version, 'str') + + # 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: + 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) + response = self._client.send(request, header_parameters, 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 + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('RegistryPolicies', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + list_policies.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/listPolicies'} + + + def _update_policies_initial( + self, resource_group_name, registry_name, quarantine_policy=None, trust_policy=None, custom_headers=None, raw=False, **operation_config): + registry_policies_update_parameters = models.RegistryPolicies(quarantine_policy=quarantine_policy, trust_policy=trust_policy) + + api_version = "2017-10-01" + + # Construct URL + url = self.update_policies.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'), + '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("api_version", api_version, 'str') + + # 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: + 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(registry_policies_update_parameters, 'RegistryPolicies') + + # Construct and send request + request = self._client.post(url, query_parameters) + response = self._client.send( + request, header_parameters, body_content, 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 + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('RegistryPolicies', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def update_policies( + self, resource_group_name, registry_name, quarantine_policy=None, trust_policy=None, custom_headers=None, raw=False, polling=True, **operation_config): + """Updates the policies for the 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 quarantine_policy: An object that represents quarantine policy + for a container registry. + :type quarantine_policy: + ~azure.mgmt.containerregistry.v2018_02_01_preview.models.QuarantinePolicy + :param trust_policy: An object that represents content trust policy + for a container registry. + :type trust_policy: + ~azure.mgmt.containerregistry.v2018_02_01_preview.models.TrustPolicy + :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 RegistryPolicies or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.containerregistry.v2018_02_01_preview.models.RegistryPolicies] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.containerregistry.v2018_02_01_preview.models.RegistryPolicies]] + :raises: :class:`CloudError` + """ + raw_result = self._update_policies_initial( + resource_group_name=resource_group_name, + registry_name=registry_name, + quarantine_policy=quarantine_policy, + trust_policy=trust_policy, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('RegistryPolicies', 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_policies.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/updatePolicies'} + def _queue_build_initial( self, resource_group_name, registry_name, build_request, custom_headers=None, raw=False, **operation_config):