From 4be0becb63406eec64d4f622300c677df47cddf3 Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Fri, 15 Jan 2021 07:02:42 +0000 Subject: [PATCH] CodeGen from PR 12438 in Azure/azure-rest-api-specs Merge b96e3ef380228cabaa8d7797b308d1ce1f89ab9b into 5df8962f094d431b8f8e7cbe143e742d316e9141 --- .../compute/_compute_management_client.py | 29 +- .../compute/aio/_compute_management_client.py | 29 +- .../azure/mgmt/compute/models.py | 1 - .../v2015_06_15/_compute_management_client.py | 1 - .../mgmt/compute/v2015_06_15/_metadata.json | 2 +- .../aio/_compute_management_client.py | 1 - .../v2016_03_30/_compute_management_client.py | 1 - .../mgmt/compute/v2016_03_30/_metadata.json | 2 +- .../aio/_compute_management_client.py | 1 - .../_compute_management_client.py | 1 - .../v2016_04_30_preview/_metadata.json | 2 +- .../aio/_compute_management_client.py | 1 - .../v2017_03_30/_compute_management_client.py | 1 - .../mgmt/compute/v2017_03_30/_metadata.json | 2 +- .../aio/_compute_management_client.py | 1 - .../v2017_09_01/_compute_management_client.py | 1 - .../mgmt/compute/v2017_09_01/_metadata.json | 2 +- .../aio/_compute_management_client.py | 1 - .../v2017_12_01/_compute_management_client.py | 1 - .../mgmt/compute/v2017_12_01/_metadata.json | 2 +- .../aio/_compute_management_client.py | 1 - .../v2018_04_01/_compute_management_client.py | 1 - .../mgmt/compute/v2018_04_01/_metadata.json | 2 +- .../aio/_compute_management_client.py | 1 - .../v2018_06_01/_compute_management_client.py | 1 - .../mgmt/compute/v2018_06_01/_metadata.json | 2 +- .../aio/_compute_management_client.py | 1 - .../v2018_09_30/_compute_management_client.py | 1 - .../mgmt/compute/v2018_09_30/_metadata.json | 2 +- .../aio/_compute_management_client.py | 1 - .../v2018_10_01/_compute_management_client.py | 1 - .../mgmt/compute/v2018_10_01/_metadata.json | 2 +- .../aio/_compute_management_client.py | 1 - .../v2019_03_01/_compute_management_client.py | 1 - .../mgmt/compute/v2019_03_01/_metadata.json | 2 +- .../aio/_compute_management_client.py | 1 - .../compute/v2019_03_01/models/__init__.py | 3 + .../_compute_management_client_enums.py | 4 +- .../compute/v2019_03_01/models/_models.py | 63 +- .../compute/v2019_03_01/models/_models_py3.py | 71 +- .../v2019_04_01/_compute_management_client.py | 1 - .../mgmt/compute/v2019_04_01/_metadata.json | 2 +- .../aio/_compute_management_client.py | 1 - .../v2019_07_01/_compute_management_client.py | 1 - .../mgmt/compute/v2019_07_01/_metadata.json | 2 +- .../aio/_compute_management_client.py | 1 - .../compute/v2019_07_01/models/__init__.py | 3 + .../_compute_management_client_enums.py | 2 +- .../compute/v2019_07_01/models/_models.py | 65 +- .../compute/v2019_07_01/models/_models_py3.py | 73 +- .../v2019_11_01/_compute_management_client.py | 1 - .../mgmt/compute/v2019_11_01/_metadata.json | 2 +- .../aio/_compute_management_client.py | 1 - .../v2019_12_01/_compute_management_client.py | 1 - .../mgmt/compute/v2019_12_01/_metadata.json | 2 +- .../aio/_compute_management_client.py | 1 - .../compute/v2019_12_01/models/__init__.py | 3 + .../compute/v2019_12_01/models/_models.py | 65 +- .../compute/v2019_12_01/models/_models_py3.py | 73 +- .../v2020_05_01/_compute_management_client.py | 1 - .../mgmt/compute/v2020_05_01/_metadata.json | 2 +- .../aio/_compute_management_client.py | 1 - .../v2020_06_01/_compute_management_client.py | 1 - .../mgmt/compute/v2020_06_01/_metadata.json | 2 +- .../aio/_compute_management_client.py | 1 - .../_virtual_machines_operations.py | 3 +- .../_compute_management_client_enums.py | 18 +- .../compute/v2020_06_01/models/_models.py | 73 +- .../compute/v2020_06_01/models/_models_py3.py | 85 +- .../_virtual_machines_operations.py | 3 +- .../v2020_06_30/_compute_management_client.py | 1 - .../mgmt/compute/v2020_06_30/_metadata.json | 2 +- .../aio/_compute_management_client.py | 1 - .../v2020_09_30/_compute_management_client.py | 26 +- .../mgmt/compute/v2020_09_30/_metadata.json | 7 +- .../aio/_compute_management_client.py | 26 +- .../v2020_09_30/aio/operations/__init__.py | 10 + .../operations/_disk_accesses_operations.py | 1066 +++++ .../_disk_encryption_sets_operations.py | 688 ++++ .../_disk_restore_point_operations.py | 195 + .../aio/operations/_disks_operations.py | 845 ++++ .../aio/operations/_snapshots_operations.py | 845 ++++ .../compute/v2020_09_30/models/__init__.py | 141 + .../_compute_management_client_enums.py | 106 +- .../compute/v2020_09_30/models/_models.py | 3379 ++++++++++++---- .../compute/v2020_09_30/models/_models_py3.py | 3588 +++++++++++++---- .../v2020_09_30/operations/__init__.py | 10 + .../operations/_disk_accesses_operations.py | 1086 +++++ .../_disk_encryption_sets_operations.py | 702 ++++ .../_disk_restore_point_operations.py | 201 + .../operations/_disks_operations.py | 862 ++++ .../operations/_snapshots_operations.py | 862 ++++ 92 files changed, 13440 insertions(+), 1943 deletions(-) create mode 100644 sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_09_30/aio/operations/_disk_accesses_operations.py create mode 100644 sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_09_30/aio/operations/_disk_encryption_sets_operations.py create mode 100644 sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_09_30/aio/operations/_disk_restore_point_operations.py create mode 100644 sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_09_30/aio/operations/_disks_operations.py create mode 100644 sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_09_30/aio/operations/_snapshots_operations.py create mode 100644 sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_09_30/operations/_disk_accesses_operations.py create mode 100644 sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_09_30/operations/_disk_encryption_sets_operations.py create mode 100644 sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_09_30/operations/_disk_restore_point_operations.py create mode 100644 sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_09_30/operations/_disks_operations.py create mode 100644 sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_09_30/operations/_snapshots_operations.py diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/_compute_management_client.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/_compute_management_client.py index f629708b1e47..07182f9f4b05 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/_compute_management_client.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/_compute_management_client.py @@ -54,15 +54,11 @@ class ComputeManagementClient(MultiApiClientMixin, _SDKClient): 'availability_sets': '2020-06-01', 'dedicated_host_groups': '2020-06-01', 'dedicated_hosts': '2020-06-01', - 'disk_accesses': '2020-06-30', - 'disk_encryption_sets': '2020-06-30', - 'disks': '2020-06-30', 'images': '2020-06-01', 'log_analytics': '2020-06-01', 'operations': '2020-06-01', 'proximity_placement_groups': '2020-06-01', 'resource_skus': '2019-04-01', - 'snapshots': '2020-06-30', 'ssh_public_keys': '2020-06-01', 'usage': '2020-06-01', 'virtual_machine_extension_images': '2020-06-01', @@ -282,12 +278,15 @@ def disk_accesses(self): * 2020-05-01: :class:`DiskAccessesOperations` * 2020-06-30: :class:`DiskAccessesOperations` + * 2020-09-30: :class:`DiskAccessesOperations` """ api_version = self._get_api_version('disk_accesses') if api_version == '2020-05-01': from .v2020_05_01.operations import DiskAccessesOperations as OperationClass elif api_version == '2020-06-30': from .v2020_06_30.operations import DiskAccessesOperations as OperationClass + elif api_version == '2020-09-30': + from .v2020_09_30.operations import DiskAccessesOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'disk_accesses'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -300,6 +299,7 @@ def disk_encryption_sets(self): * 2019-11-01: :class:`DiskEncryptionSetsOperations` * 2020-05-01: :class:`DiskEncryptionSetsOperations` * 2020-06-30: :class:`DiskEncryptionSetsOperations` + * 2020-09-30: :class:`DiskEncryptionSetsOperations` """ api_version = self._get_api_version('disk_encryption_sets') if api_version == '2019-07-01': @@ -310,10 +310,25 @@ def disk_encryption_sets(self): from .v2020_05_01.operations import DiskEncryptionSetsOperations as OperationClass elif api_version == '2020-06-30': from .v2020_06_30.operations import DiskEncryptionSetsOperations as OperationClass + elif api_version == '2020-09-30': + from .v2020_09_30.operations import DiskEncryptionSetsOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'disk_encryption_sets'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) + @property + def disk_restore_point(self): + """Instance depends on the API version: + + * 2020-09-30: :class:`DiskRestorePointOperations` + """ + api_version = self._get_api_version('disk_restore_point') + if api_version == '2020-09-30': + from .v2020_09_30.operations import DiskRestorePointOperations as OperationClass + else: + raise ValueError("API version {} does not have operation group 'disk_restore_point'".format(api_version)) + return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) + @property def disks(self): """Instance depends on the API version: @@ -328,6 +343,7 @@ def disks(self): * 2019-11-01: :class:`DisksOperations` * 2020-05-01: :class:`DisksOperations` * 2020-06-30: :class:`DisksOperations` + * 2020-09-30: :class:`DisksOperations` """ api_version = self._get_api_version('disks') if api_version == '2016-04-30-preview': @@ -350,6 +366,8 @@ def disks(self): from .v2020_05_01.operations import DisksOperations as OperationClass elif api_version == '2020-06-30': from .v2020_06_30.operations import DisksOperations as OperationClass + elif api_version == '2020-09-30': + from .v2020_09_30.operations import DisksOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'disks'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -697,6 +715,7 @@ def snapshots(self): * 2019-11-01: :class:`SnapshotsOperations` * 2020-05-01: :class:`SnapshotsOperations` * 2020-06-30: :class:`SnapshotsOperations` + * 2020-09-30: :class:`SnapshotsOperations` """ api_version = self._get_api_version('snapshots') if api_version == '2016-04-30-preview': @@ -719,6 +738,8 @@ def snapshots(self): from .v2020_05_01.operations import SnapshotsOperations as OperationClass elif api_version == '2020-06-30': from .v2020_06_30.operations import SnapshotsOperations as OperationClass + elif api_version == '2020-09-30': + from .v2020_09_30.operations import SnapshotsOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'snapshots'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/aio/_compute_management_client.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/aio/_compute_management_client.py index 20cf0a6c3c31..6f473131d35d 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/aio/_compute_management_client.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/aio/_compute_management_client.py @@ -54,15 +54,11 @@ class ComputeManagementClient(MultiApiClientMixin, _SDKClient): 'availability_sets': '2020-06-01', 'dedicated_host_groups': '2020-06-01', 'dedicated_hosts': '2020-06-01', - 'disk_accesses': '2020-06-30', - 'disk_encryption_sets': '2020-06-30', - 'disks': '2020-06-30', 'images': '2020-06-01', 'log_analytics': '2020-06-01', 'operations': '2020-06-01', 'proximity_placement_groups': '2020-06-01', 'resource_skus': '2019-04-01', - 'snapshots': '2020-06-30', 'ssh_public_keys': '2020-06-01', 'usage': '2020-06-01', 'virtual_machine_extension_images': '2020-06-01', @@ -282,12 +278,15 @@ def disk_accesses(self): * 2020-05-01: :class:`DiskAccessesOperations` * 2020-06-30: :class:`DiskAccessesOperations` + * 2020-09-30: :class:`DiskAccessesOperations` """ api_version = self._get_api_version('disk_accesses') if api_version == '2020-05-01': from ..v2020_05_01.aio.operations import DiskAccessesOperations as OperationClass elif api_version == '2020-06-30': from ..v2020_06_30.aio.operations import DiskAccessesOperations as OperationClass + elif api_version == '2020-09-30': + from ..v2020_09_30.aio.operations import DiskAccessesOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'disk_accesses'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -300,6 +299,7 @@ def disk_encryption_sets(self): * 2019-11-01: :class:`DiskEncryptionSetsOperations` * 2020-05-01: :class:`DiskEncryptionSetsOperations` * 2020-06-30: :class:`DiskEncryptionSetsOperations` + * 2020-09-30: :class:`DiskEncryptionSetsOperations` """ api_version = self._get_api_version('disk_encryption_sets') if api_version == '2019-07-01': @@ -310,10 +310,25 @@ def disk_encryption_sets(self): from ..v2020_05_01.aio.operations import DiskEncryptionSetsOperations as OperationClass elif api_version == '2020-06-30': from ..v2020_06_30.aio.operations import DiskEncryptionSetsOperations as OperationClass + elif api_version == '2020-09-30': + from ..v2020_09_30.aio.operations import DiskEncryptionSetsOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'disk_encryption_sets'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) + @property + def disk_restore_point(self): + """Instance depends on the API version: + + * 2020-09-30: :class:`DiskRestorePointOperations` + """ + api_version = self._get_api_version('disk_restore_point') + if api_version == '2020-09-30': + from ..v2020_09_30.aio.operations import DiskRestorePointOperations as OperationClass + else: + raise ValueError("API version {} does not have operation group 'disk_restore_point'".format(api_version)) + return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) + @property def disks(self): """Instance depends on the API version: @@ -328,6 +343,7 @@ def disks(self): * 2019-11-01: :class:`DisksOperations` * 2020-05-01: :class:`DisksOperations` * 2020-06-30: :class:`DisksOperations` + * 2020-09-30: :class:`DisksOperations` """ api_version = self._get_api_version('disks') if api_version == '2016-04-30-preview': @@ -350,6 +366,8 @@ def disks(self): from ..v2020_05_01.aio.operations import DisksOperations as OperationClass elif api_version == '2020-06-30': from ..v2020_06_30.aio.operations import DisksOperations as OperationClass + elif api_version == '2020-09-30': + from ..v2020_09_30.aio.operations import DisksOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'disks'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -697,6 +715,7 @@ def snapshots(self): * 2019-11-01: :class:`SnapshotsOperations` * 2020-05-01: :class:`SnapshotsOperations` * 2020-06-30: :class:`SnapshotsOperations` + * 2020-09-30: :class:`SnapshotsOperations` """ api_version = self._get_api_version('snapshots') if api_version == '2016-04-30-preview': @@ -719,6 +738,8 @@ def snapshots(self): from ..v2020_05_01.aio.operations import SnapshotsOperations as OperationClass elif api_version == '2020-06-30': from ..v2020_06_30.aio.operations import SnapshotsOperations as OperationClass + elif api_version == '2020-09-30': + from ..v2020_09_30.aio.operations import SnapshotsOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'snapshots'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/models.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/models.py index 2200c7842cfa..03e48f7e6e47 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/models.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/models.py @@ -6,5 +6,4 @@ # -------------------------------------------------------------------------- from .v2019_04_01.models import * from .v2020_06_01.models import * -from .v2020_06_30.models import * from .v2020_09_30.models import * diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/_compute_management_client.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/_compute_management_client.py index c94784b71eac..a273916fd4e8 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/_compute_management_client.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/_compute_management_client.py @@ -74,7 +74,6 @@ def __init__( client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) - self._serialize.client_side_validation = False self._deserialize = Deserializer(client_models) self.availability_sets = AvailabilitySetsOperations( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/_metadata.json b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/_metadata.json index 1df14167dfb6..c5ae18910e14 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/_metadata.json +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/_metadata.json @@ -9,7 +9,7 @@ "custom_base_url": null, "azure_arm": true, "has_lro_operations": true, - "client_side_validation": false + "client_side_validation": true }, "global_parameters": { "sync": { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/aio/_compute_management_client.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/aio/_compute_management_client.py index e31ce000b06c..f81704a44e6d 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/aio/_compute_management_client.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/aio/_compute_management_client.py @@ -71,7 +71,6 @@ def __init__( client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) - self._serialize.client_side_validation = False self._deserialize = Deserializer(client_models) self.availability_sets = AvailabilitySetsOperations( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/_compute_management_client.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/_compute_management_client.py index 8e306e622dbd..7edb8482424a 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/_compute_management_client.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/_compute_management_client.py @@ -74,7 +74,6 @@ def __init__( client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) - self._serialize.client_side_validation = False self._deserialize = Deserializer(client_models) self.availability_sets = AvailabilitySetsOperations( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/_metadata.json b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/_metadata.json index 04f09ded3dc8..37f9b3996590 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/_metadata.json +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/_metadata.json @@ -9,7 +9,7 @@ "custom_base_url": null, "azure_arm": true, "has_lro_operations": true, - "client_side_validation": false + "client_side_validation": true }, "global_parameters": { "sync": { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/aio/_compute_management_client.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/aio/_compute_management_client.py index ad94a530b8f9..46dd3529656f 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/aio/_compute_management_client.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/aio/_compute_management_client.py @@ -71,7 +71,6 @@ def __init__( client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) - self._serialize.client_side_validation = False self._deserialize = Deserializer(client_models) self.availability_sets = AvailabilitySetsOperations( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/_compute_management_client.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/_compute_management_client.py index c08c09d03e0b..78e44772189d 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/_compute_management_client.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/_compute_management_client.py @@ -83,7 +83,6 @@ def __init__( client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) - self._serialize.client_side_validation = False self._deserialize = Deserializer(client_models) self.availability_sets = AvailabilitySetsOperations( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/_metadata.json b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/_metadata.json index 99ba10ca9bf0..62448e4f1afc 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/_metadata.json +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/_metadata.json @@ -9,7 +9,7 @@ "custom_base_url": null, "azure_arm": true, "has_lro_operations": true, - "client_side_validation": false + "client_side_validation": true }, "global_parameters": { "sync": { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/aio/_compute_management_client.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/aio/_compute_management_client.py index 5a3172727c21..e09d7b7b333c 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/aio/_compute_management_client.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/aio/_compute_management_client.py @@ -80,7 +80,6 @@ def __init__( client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) - self._serialize.client_side_validation = False self._deserialize = Deserializer(client_models) self.availability_sets = AvailabilitySetsOperations( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/_compute_management_client.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/_compute_management_client.py index a3f24ad7ea95..1e1a2c60870a 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/_compute_management_client.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/_compute_management_client.py @@ -95,7 +95,6 @@ def __init__( client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) - self._serialize.client_side_validation = False self._deserialize = Deserializer(client_models) self.availability_sets = AvailabilitySetsOperations( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/_metadata.json b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/_metadata.json index 639eadfae933..e85e400e7025 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/_metadata.json +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/_metadata.json @@ -9,7 +9,7 @@ "custom_base_url": null, "azure_arm": true, "has_lro_operations": true, - "client_side_validation": false + "client_side_validation": true }, "global_parameters": { "sync": { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/aio/_compute_management_client.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/aio/_compute_management_client.py index 133537d9ab00..f429d5f056b8 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/aio/_compute_management_client.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/aio/_compute_management_client.py @@ -92,7 +92,6 @@ def __init__( client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) - self._serialize.client_side_validation = False self._deserialize = Deserializer(client_models) self.availability_sets = AvailabilitySetsOperations( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_09_01/_compute_management_client.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_09_01/_compute_management_client.py index 66122fb73dba..6368f16c96cf 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_09_01/_compute_management_client.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_09_01/_compute_management_client.py @@ -49,7 +49,6 @@ def __init__( client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) - self._serialize.client_side_validation = False self._deserialize = Deserializer(client_models) self.resource_skus = ResourceSkusOperations( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_09_01/_metadata.json b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_09_01/_metadata.json index 6ca366133d9d..467ff43bc4db 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_09_01/_metadata.json +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_09_01/_metadata.json @@ -9,7 +9,7 @@ "custom_base_url": null, "azure_arm": true, "has_lro_operations": false, - "client_side_validation": false + "client_side_validation": true }, "global_parameters": { "sync": { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_09_01/aio/_compute_management_client.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_09_01/aio/_compute_management_client.py index 9ec019284e19..776d35cc29ff 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_09_01/aio/_compute_management_client.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_09_01/aio/_compute_management_client.py @@ -46,7 +46,6 @@ def __init__( client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) - self._serialize.client_side_validation = False self._deserialize = Deserializer(client_models) self.resource_skus = ResourceSkusOperations( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/_compute_management_client.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/_compute_management_client.py index 7a360591eb8b..9a9611a8c9f6 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/_compute_management_client.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/_compute_management_client.py @@ -92,7 +92,6 @@ def __init__( client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) - self._serialize.client_side_validation = False self._deserialize = Deserializer(client_models) self.operations = Operations( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/_metadata.json b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/_metadata.json index 2f8b474eb381..9ab3383f8403 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/_metadata.json +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/_metadata.json @@ -9,7 +9,7 @@ "custom_base_url": null, "azure_arm": true, "has_lro_operations": true, - "client_side_validation": false + "client_side_validation": true }, "global_parameters": { "sync": { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/aio/_compute_management_client.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/aio/_compute_management_client.py index 0754de1374fe..38a400fc36ad 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/aio/_compute_management_client.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/aio/_compute_management_client.py @@ -89,7 +89,6 @@ def __init__( client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) - self._serialize.client_side_validation = False self._deserialize = Deserializer(client_models) self.operations = Operations( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/_compute_management_client.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/_compute_management_client.py index 66b3b35b3cbc..d6901f63cdda 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/_compute_management_client.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/_compute_management_client.py @@ -101,7 +101,6 @@ def __init__( client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) - self._serialize.client_side_validation = False self._deserialize = Deserializer(client_models) self.operations = Operations( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/_metadata.json b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/_metadata.json index 6f92f2607fed..1d932f19740d 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/_metadata.json +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/_metadata.json @@ -9,7 +9,7 @@ "custom_base_url": null, "azure_arm": true, "has_lro_operations": true, - "client_side_validation": false + "client_side_validation": true }, "global_parameters": { "sync": { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/aio/_compute_management_client.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/aio/_compute_management_client.py index 5e5dd5ce489b..5b8f59f9cebb 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/aio/_compute_management_client.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/aio/_compute_management_client.py @@ -98,7 +98,6 @@ def __init__( client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) - self._serialize.client_side_validation = False self._deserialize = Deserializer(client_models) self.operations = Operations( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/_compute_management_client.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/_compute_management_client.py index b4d1044819de..c5ea10d2c456 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/_compute_management_client.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/_compute_management_client.py @@ -110,7 +110,6 @@ def __init__( client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) - self._serialize.client_side_validation = False self._deserialize = Deserializer(client_models) self.operations = Operations( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/_metadata.json b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/_metadata.json index 13888d348942..87dcb6cf550e 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/_metadata.json +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/_metadata.json @@ -9,7 +9,7 @@ "custom_base_url": null, "azure_arm": true, "has_lro_operations": true, - "client_side_validation": false + "client_side_validation": true }, "global_parameters": { "sync": { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/aio/_compute_management_client.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/aio/_compute_management_client.py index 030b7ef0107e..db8c7aee77a9 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/aio/_compute_management_client.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/aio/_compute_management_client.py @@ -107,7 +107,6 @@ def __init__( client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) - self._serialize.client_side_validation = False self._deserialize = Deserializer(client_models) self.operations = Operations( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_09_30/_compute_management_client.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_09_30/_compute_management_client.py index d85a35770ba6..0b41e738e9af 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_09_30/_compute_management_client.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_09_30/_compute_management_client.py @@ -53,7 +53,6 @@ def __init__( client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) - self._serialize.client_side_validation = False self._deserialize = Deserializer(client_models) self.disks = DisksOperations( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_09_30/_metadata.json b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_09_30/_metadata.json index 58f99b6d06c7..8d4e2870a5cd 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_09_30/_metadata.json +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_09_30/_metadata.json @@ -9,7 +9,7 @@ "custom_base_url": null, "azure_arm": true, "has_lro_operations": true, - "client_side_validation": false + "client_side_validation": true }, "global_parameters": { "sync": { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_09_30/aio/_compute_management_client.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_09_30/aio/_compute_management_client.py index 41d9fcafc629..553c60a12702 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_09_30/aio/_compute_management_client.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_09_30/aio/_compute_management_client.py @@ -50,7 +50,6 @@ def __init__( client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) - self._serialize.client_side_validation = False self._deserialize = Deserializer(client_models) self.disks = DisksOperations( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/_compute_management_client.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/_compute_management_client.py index f205577bc9ed..8891128c9fd0 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/_compute_management_client.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/_compute_management_client.py @@ -95,7 +95,6 @@ def __init__( client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) - self._serialize.client_side_validation = False self._deserialize = Deserializer(client_models) self.operations = Operations( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/_metadata.json b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/_metadata.json index f2188a845344..802f47d3e80e 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/_metadata.json +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/_metadata.json @@ -9,7 +9,7 @@ "custom_base_url": null, "azure_arm": true, "has_lro_operations": true, - "client_side_validation": false + "client_side_validation": true }, "global_parameters": { "sync": { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/aio/_compute_management_client.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/aio/_compute_management_client.py index 4109da03e7d8..54e61613647c 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/aio/_compute_management_client.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/aio/_compute_management_client.py @@ -92,7 +92,6 @@ def __init__( client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) - self._serialize.client_side_validation = False self._deserialize = Deserializer(client_models) self.operations = Operations( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/_compute_management_client.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/_compute_management_client.py index 8bedc447edfc..e2953855e407 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/_compute_management_client.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/_compute_management_client.py @@ -122,7 +122,6 @@ def __init__( client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) - self._serialize.client_side_validation = False self._deserialize = Deserializer(client_models) self.operations = Operations( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/_metadata.json b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/_metadata.json index 00cd0651a521..d0ba101bd3d3 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/_metadata.json +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/_metadata.json @@ -9,7 +9,7 @@ "custom_base_url": null, "azure_arm": true, "has_lro_operations": true, - "client_side_validation": false + "client_side_validation": true }, "global_parameters": { "sync": { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/aio/_compute_management_client.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/aio/_compute_management_client.py index f08ee4eeb543..eb0e927e52f0 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/aio/_compute_management_client.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/aio/_compute_management_client.py @@ -119,7 +119,6 @@ def __init__( client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) - self._serialize.client_side_validation = False self._deserialize = Deserializer(client_models) self.operations = Operations( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/models/__init__.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/models/__init__.py index 9cfc43b8bf87..998f7ba41e89 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/models/__init__.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/models/__init__.py @@ -144,6 +144,7 @@ from ._models_py3 import UpgradePolicy from ._models_py3 import Usage from ._models_py3 import UsageName + from ._models_py3 import UserArtifactManage from ._models_py3 import UserArtifactSource from ._models_py3 import UserAssignedIdentitiesValue from ._models_py3 import VMScaleSetConvertToSinglePlacementGroupInput @@ -358,6 +359,7 @@ from ._models import UpgradePolicy # type: ignore from ._models import Usage # type: ignore from ._models import UsageName # type: ignore + from ._models import UserArtifactManage # type: ignore from ._models import UserArtifactSource # type: ignore from ._models import UserAssignedIdentitiesValue # type: ignore from ._models import VMScaleSetConvertToSinglePlacementGroupInput # type: ignore @@ -619,6 +621,7 @@ 'UpgradePolicy', 'Usage', 'UsageName', + 'UserArtifactManage', 'UserArtifactSource', 'UserAssignedIdentitiesValue', 'VMScaleSetConvertToSinglePlacementGroupInput', diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/models/_compute_management_client_enums.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/models/_compute_management_client_enums.py index 686b80d8b893..b6a6cd2f8b49 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/models/_compute_management_client_enums.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/models/_compute_management_client_enums.py @@ -230,9 +230,7 @@ class OperatingSystemStateTypes(with_metaclass(_CaseInsensitiveEnumMeta, str, En SPECIALIZED = "Specialized" #: Specialized image. Contains already provisioned OS Disk. class OperatingSystemTypes(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): - """This property allows you to specify the supported type of the OS that application is built for. - :code:`
`:code:`
` Possible values are: :code:`
`:code:`
` **Windows** - :code:`
`:code:`
` **Linux** + """The operating system of the osDiskImage. """ WINDOWS = "Windows" diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/models/_models.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/models/_models.py index 84584b2e26a4..8895cf70ed61 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/models/_models.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/models/_models.py @@ -1790,7 +1790,7 @@ class GalleryApplicationVersion(Resource): :type location: str :param tags: A set of tags. Resource tags. :type tags: dict[str, str] - :param publishing_profile: The publishing profile of a gallery Image Version. + :param publishing_profile: The publishing profile of a gallery image version. :type publishing_profile: ~azure.mgmt.compute.v2019_03_01.models.GalleryApplicationVersionPublishingProfile :ivar provisioning_state: The provisioning state, which only appears in the response. Possible @@ -1913,7 +1913,7 @@ def __init__( class GalleryApplicationVersionPublishingProfile(GalleryArtifactPublishingProfileBase): - """The publishing profile of a gallery Image Version. + """The publishing profile of a gallery image version. Variables are only populated by the server, and will be ignored when sending a request. @@ -1939,9 +1939,8 @@ class GalleryApplicationVersionPublishingProfile(GalleryArtifactPublishingProfil :type storage_account_type: str or ~azure.mgmt.compute.v2019_03_01.models.StorageAccountType :param source: Required. The source image from which the Image Version is going to be created. :type source: ~azure.mgmt.compute.v2019_03_01.models.UserArtifactSource - :param content_type: Optional. May be used to help process this file. The type of file - contained in the source, e.g. zip, json, etc. - :type content_type: str + :param manage_actions: + :type manage_actions: ~azure.mgmt.compute.v2019_03_01.models.UserArtifactManage :param enable_health_check: Optional. Whether or not this application reports health. :type enable_health_check: bool """ @@ -1959,7 +1958,7 @@ class GalleryApplicationVersionPublishingProfile(GalleryArtifactPublishingProfil 'end_of_life_date': {'key': 'endOfLifeDate', 'type': 'iso-8601'}, 'storage_account_type': {'key': 'storageAccountType', 'type': 'str'}, 'source': {'key': 'source', 'type': 'UserArtifactSource'}, - 'content_type': {'key': 'contentType', 'type': 'str'}, + 'manage_actions': {'key': 'manageActions', 'type': 'UserArtifactManage'}, 'enable_health_check': {'key': 'enableHealthCheck', 'type': 'bool'}, } @@ -1969,7 +1968,7 @@ def __init__( ): super(GalleryApplicationVersionPublishingProfile, self).__init__(**kwargs) self.source = kwargs['source'] - self.content_type = kwargs.get('content_type', None) + self.manage_actions = kwargs.get('manage_actions', None) self.enable_health_check = kwargs.get('enable_health_check', None) @@ -5278,26 +5277,64 @@ def __init__( self.localized_value = kwargs.get('localized_value', None) +class UserArtifactManage(msrest.serialization.Model): + """UserArtifactManage. + + All required parameters must be populated in order to send to Azure. + + :param install: Required. Required. The path and arguments to install the gallery application. + This is limited to 4096 characters. + :type install: str + :param remove: Required. Required. The path and arguments to remove the gallery application. + This is limited to 4096 characters. + :type remove: str + :param update: Optional. The path and arguments to update the gallery application. If not + present, then update operation will invoke remove command on the previous version and install + command on the current version of the gallery application. This is limited to 4096 characters. + :type update: str + """ + + _validation = { + 'install': {'required': True}, + 'remove': {'required': True}, + } + + _attribute_map = { + 'install': {'key': 'install', 'type': 'str'}, + 'remove': {'key': 'remove', 'type': 'str'}, + 'update': {'key': 'update', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(UserArtifactManage, self).__init__(**kwargs) + self.install = kwargs['install'] + self.remove = kwargs['remove'] + self.update = kwargs.get('update', None) + + class UserArtifactSource(msrest.serialization.Model): """The source image from which the Image Version is going to be created. All required parameters must be populated in order to send to Azure. - :param file_name: Required. Required. The fileName of the artifact. - :type file_name: str :param media_link: Required. Required. The mediaLink of the artifact, must be a readable - storage blob. + storage page blob. :type media_link: str + :param default_configuration_link: Optional. The defaultConfigurationLink of the artifact, must + be a readable storage page blob. + :type default_configuration_link: str """ _validation = { - 'file_name': {'required': True}, 'media_link': {'required': True}, } _attribute_map = { - 'file_name': {'key': 'fileName', 'type': 'str'}, 'media_link': {'key': 'mediaLink', 'type': 'str'}, + 'default_configuration_link': {'key': 'defaultConfigurationLink', 'type': 'str'}, } def __init__( @@ -5305,8 +5342,8 @@ def __init__( **kwargs ): super(UserArtifactSource, self).__init__(**kwargs) - self.file_name = kwargs['file_name'] self.media_link = kwargs['media_link'] + self.default_configuration_link = kwargs.get('default_configuration_link', None) class UserAssignedIdentitiesValue(msrest.serialization.Model): diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/models/_models_py3.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/models/_models_py3.py index 2ef70acccf80..40bea055ee16 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/models/_models_py3.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/models/_models_py3.py @@ -1964,7 +1964,7 @@ class GalleryApplicationVersion(Resource): :type location: str :param tags: A set of tags. Resource tags. :type tags: dict[str, str] - :param publishing_profile: The publishing profile of a gallery Image Version. + :param publishing_profile: The publishing profile of a gallery image version. :type publishing_profile: ~azure.mgmt.compute.v2019_03_01.models.GalleryApplicationVersionPublishingProfile :ivar provisioning_state: The provisioning state, which only appears in the response. Possible @@ -2100,7 +2100,7 @@ def __init__( class GalleryApplicationVersionPublishingProfile(GalleryArtifactPublishingProfileBase): - """The publishing profile of a gallery Image Version. + """The publishing profile of a gallery image version. Variables are only populated by the server, and will be ignored when sending a request. @@ -2126,9 +2126,8 @@ class GalleryApplicationVersionPublishingProfile(GalleryArtifactPublishingProfil :type storage_account_type: str or ~azure.mgmt.compute.v2019_03_01.models.StorageAccountType :param source: Required. The source image from which the Image Version is going to be created. :type source: ~azure.mgmt.compute.v2019_03_01.models.UserArtifactSource - :param content_type: Optional. May be used to help process this file. The type of file - contained in the source, e.g. zip, json, etc. - :type content_type: str + :param manage_actions: + :type manage_actions: ~azure.mgmt.compute.v2019_03_01.models.UserArtifactManage :param enable_health_check: Optional. Whether or not this application reports health. :type enable_health_check: bool """ @@ -2146,7 +2145,7 @@ class GalleryApplicationVersionPublishingProfile(GalleryArtifactPublishingProfil 'end_of_life_date': {'key': 'endOfLifeDate', 'type': 'iso-8601'}, 'storage_account_type': {'key': 'storageAccountType', 'type': 'str'}, 'source': {'key': 'source', 'type': 'UserArtifactSource'}, - 'content_type': {'key': 'contentType', 'type': 'str'}, + 'manage_actions': {'key': 'manageActions', 'type': 'UserArtifactManage'}, 'enable_health_check': {'key': 'enableHealthCheck', 'type': 'bool'}, } @@ -2159,13 +2158,13 @@ def __init__( exclude_from_latest: Optional[bool] = None, end_of_life_date: Optional[datetime.datetime] = None, storage_account_type: Optional[Union[str, "StorageAccountType"]] = None, - content_type: Optional[str] = None, + manage_actions: Optional["UserArtifactManage"] = None, enable_health_check: Optional[bool] = None, **kwargs ): super(GalleryApplicationVersionPublishingProfile, self).__init__(target_regions=target_regions, replica_count=replica_count, exclude_from_latest=exclude_from_latest, end_of_life_date=end_of_life_date, storage_account_type=storage_account_type, **kwargs) self.source = source - self.content_type = content_type + self.manage_actions = manage_actions self.enable_health_check = enable_health_check @@ -5782,38 +5781,80 @@ def __init__( self.localized_value = localized_value +class UserArtifactManage(msrest.serialization.Model): + """UserArtifactManage. + + All required parameters must be populated in order to send to Azure. + + :param install: Required. Required. The path and arguments to install the gallery application. + This is limited to 4096 characters. + :type install: str + :param remove: Required. Required. The path and arguments to remove the gallery application. + This is limited to 4096 characters. + :type remove: str + :param update: Optional. The path and arguments to update the gallery application. If not + present, then update operation will invoke remove command on the previous version and install + command on the current version of the gallery application. This is limited to 4096 characters. + :type update: str + """ + + _validation = { + 'install': {'required': True}, + 'remove': {'required': True}, + } + + _attribute_map = { + 'install': {'key': 'install', 'type': 'str'}, + 'remove': {'key': 'remove', 'type': 'str'}, + 'update': {'key': 'update', 'type': 'str'}, + } + + def __init__( + self, + *, + install: str, + remove: str, + update: Optional[str] = None, + **kwargs + ): + super(UserArtifactManage, self).__init__(**kwargs) + self.install = install + self.remove = remove + self.update = update + + class UserArtifactSource(msrest.serialization.Model): """The source image from which the Image Version is going to be created. All required parameters must be populated in order to send to Azure. - :param file_name: Required. Required. The fileName of the artifact. - :type file_name: str :param media_link: Required. Required. The mediaLink of the artifact, must be a readable - storage blob. + storage page blob. :type media_link: str + :param default_configuration_link: Optional. The defaultConfigurationLink of the artifact, must + be a readable storage page blob. + :type default_configuration_link: str """ _validation = { - 'file_name': {'required': True}, 'media_link': {'required': True}, } _attribute_map = { - 'file_name': {'key': 'fileName', 'type': 'str'}, 'media_link': {'key': 'mediaLink', 'type': 'str'}, + 'default_configuration_link': {'key': 'defaultConfigurationLink', 'type': 'str'}, } def __init__( self, *, - file_name: str, media_link: str, + default_configuration_link: Optional[str] = None, **kwargs ): super(UserArtifactSource, self).__init__(**kwargs) - self.file_name = file_name self.media_link = media_link + self.default_configuration_link = default_configuration_link class UserAssignedIdentitiesValue(msrest.serialization.Model): diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_04_01/_compute_management_client.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_04_01/_compute_management_client.py index cbbf6786ef71..176fa891f0b9 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_04_01/_compute_management_client.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_04_01/_compute_management_client.py @@ -49,7 +49,6 @@ def __init__( client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) - self._serialize.client_side_validation = False self._deserialize = Deserializer(client_models) self.resource_skus = ResourceSkusOperations( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_04_01/_metadata.json b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_04_01/_metadata.json index 0db25c4e3362..c904a0aaa56e 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_04_01/_metadata.json +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_04_01/_metadata.json @@ -9,7 +9,7 @@ "custom_base_url": null, "azure_arm": true, "has_lro_operations": false, - "client_side_validation": false + "client_side_validation": true }, "global_parameters": { "sync": { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_04_01/aio/_compute_management_client.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_04_01/aio/_compute_management_client.py index 8ff46cd8a872..3e04870a583b 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_04_01/aio/_compute_management_client.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_04_01/aio/_compute_management_client.py @@ -46,7 +46,6 @@ def __init__( client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) - self._serialize.client_side_validation = False self._deserialize = Deserializer(client_models) self.resource_skus = ResourceSkusOperations( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/_compute_management_client.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/_compute_management_client.py index 7a3a61413914..6552f8960011 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/_compute_management_client.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/_compute_management_client.py @@ -128,7 +128,6 @@ def __init__( client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) - self._serialize.client_side_validation = False self._deserialize = Deserializer(client_models) self.operations = Operations( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/_metadata.json b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/_metadata.json index 708482f34e5a..5c69075854fe 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/_metadata.json +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/_metadata.json @@ -9,7 +9,7 @@ "custom_base_url": null, "azure_arm": true, "has_lro_operations": true, - "client_side_validation": false + "client_side_validation": true }, "global_parameters": { "sync": { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/_compute_management_client.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/_compute_management_client.py index f161044379f0..74b0eac5cb08 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/_compute_management_client.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/aio/_compute_management_client.py @@ -125,7 +125,6 @@ def __init__( client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) - self._serialize.client_side_validation = False self._deserialize = Deserializer(client_models) self.operations = Operations( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/models/__init__.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/models/__init__.py index 705444a63a8e..17aabb899970 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/models/__init__.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/models/__init__.py @@ -158,6 +158,7 @@ from ._models_py3 import UpgradePolicy from ._models_py3 import Usage from ._models_py3 import UsageName + from ._models_py3 import UserArtifactManage from ._models_py3 import UserArtifactSource from ._models_py3 import UserAssignedIdentitiesValue from ._models_py3 import VMScaleSetConvertToSinglePlacementGroupInput @@ -387,6 +388,7 @@ from ._models import UpgradePolicy # type: ignore from ._models import Usage # type: ignore from ._models import UsageName # type: ignore + from ._models import UserArtifactManage # type: ignore from ._models import UserArtifactSource # type: ignore from ._models import UserAssignedIdentitiesValue # type: ignore from ._models import VMScaleSetConvertToSinglePlacementGroupInput # type: ignore @@ -665,6 +667,7 @@ 'UpgradePolicy', 'Usage', 'UsageName', + 'UserArtifactManage', 'UserArtifactSource', 'UserAssignedIdentitiesValue', 'VMScaleSetConvertToSinglePlacementGroupInput', diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/models/_compute_management_client_enums.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/models/_compute_management_client_enums.py index 2c8c68dcba49..db5174b68e4e 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/models/_compute_management_client_enums.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/models/_compute_management_client_enums.py @@ -243,7 +243,7 @@ class OperatingSystemStateTypes(with_metaclass(_CaseInsensitiveEnumMeta, str, En SPECIALIZED = "Specialized" #: Specialized image. Contains already provisioned OS Disk. class OperatingSystemTypes(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): - """The Operating System type. + """The operating system of the osDiskImage. """ WINDOWS = "Windows" diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/models/_models.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/models/_models.py index 7ea5aff57707..b753791be8ba 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/models/_models.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/models/_models.py @@ -2085,7 +2085,7 @@ class GalleryApplicationVersion(Resource): :type location: str :param tags: A set of tags. Resource tags. :type tags: dict[str, str] - :param publishing_profile: The publishing profile of a gallery Image Version. + :param publishing_profile: The publishing profile of a gallery image version. :type publishing_profile: ~azure.mgmt.compute.v2019_07_01.models.GalleryApplicationVersionPublishingProfile :ivar provisioning_state: The provisioning state, which only appears in the response. Possible @@ -2208,7 +2208,7 @@ def __init__( class GalleryApplicationVersionPublishingProfile(GalleryArtifactPublishingProfileBase): - """The publishing profile of a gallery Image Version. + """The publishing profile of a gallery image version. Variables are only populated by the server, and will be ignored when sending a request. @@ -2234,9 +2234,8 @@ class GalleryApplicationVersionPublishingProfile(GalleryArtifactPublishingProfil :type storage_account_type: str or ~azure.mgmt.compute.v2019_07_01.models.StorageAccountType :param source: Required. The source image from which the Image Version is going to be created. :type source: ~azure.mgmt.compute.v2019_07_01.models.UserArtifactSource - :param content_type: Optional. May be used to help process this file. The type of file - contained in the source, e.g. zip, json, etc. - :type content_type: str + :param manage_actions: + :type manage_actions: ~azure.mgmt.compute.v2019_07_01.models.UserArtifactManage :param enable_health_check: Optional. Whether or not this application reports health. :type enable_health_check: bool """ @@ -2254,7 +2253,7 @@ class GalleryApplicationVersionPublishingProfile(GalleryArtifactPublishingProfil 'end_of_life_date': {'key': 'endOfLifeDate', 'type': 'iso-8601'}, 'storage_account_type': {'key': 'storageAccountType', 'type': 'str'}, 'source': {'key': 'source', 'type': 'UserArtifactSource'}, - 'content_type': {'key': 'contentType', 'type': 'str'}, + 'manage_actions': {'key': 'manageActions', 'type': 'UserArtifactManage'}, 'enable_health_check': {'key': 'enableHealthCheck', 'type': 'bool'}, } @@ -2264,7 +2263,7 @@ def __init__( ): super(GalleryApplicationVersionPublishingProfile, self).__init__(**kwargs) self.source = kwargs['source'] - self.content_type = kwargs.get('content_type', None) + self.manage_actions = kwargs.get('manage_actions', None) self.enable_health_check = kwargs.get('enable_health_check', None) @@ -2275,7 +2274,7 @@ class GalleryApplicationVersionUpdate(UpdateResource): :param tags: A set of tags. Resource tags. :type tags: dict[str, str] - :param publishing_profile: The publishing profile of a gallery Image Version. + :param publishing_profile: The publishing profile of a gallery image version. :type publishing_profile: ~azure.mgmt.compute.v2019_07_01.models.GalleryApplicationVersionPublishingProfile :ivar provisioning_state: The provisioning state, which only appears in the response. Possible @@ -5897,26 +5896,64 @@ def __init__( self.localized_value = kwargs.get('localized_value', None) +class UserArtifactManage(msrest.serialization.Model): + """UserArtifactManage. + + All required parameters must be populated in order to send to Azure. + + :param install: Required. Required. The path and arguments to install the gallery application. + This is limited to 4096 characters. + :type install: str + :param remove: Required. Required. The path and arguments to remove the gallery application. + This is limited to 4096 characters. + :type remove: str + :param update: Optional. The path and arguments to update the gallery application. If not + present, then update operation will invoke remove command on the previous version and install + command on the current version of the gallery application. This is limited to 4096 characters. + :type update: str + """ + + _validation = { + 'install': {'required': True}, + 'remove': {'required': True}, + } + + _attribute_map = { + 'install': {'key': 'install', 'type': 'str'}, + 'remove': {'key': 'remove', 'type': 'str'}, + 'update': {'key': 'update', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(UserArtifactManage, self).__init__(**kwargs) + self.install = kwargs['install'] + self.remove = kwargs['remove'] + self.update = kwargs.get('update', None) + + class UserArtifactSource(msrest.serialization.Model): """The source image from which the Image Version is going to be created. All required parameters must be populated in order to send to Azure. - :param file_name: Required. Required. The fileName of the artifact. - :type file_name: str :param media_link: Required. Required. The mediaLink of the artifact, must be a readable - storage blob. + storage page blob. :type media_link: str + :param default_configuration_link: Optional. The defaultConfigurationLink of the artifact, must + be a readable storage page blob. + :type default_configuration_link: str """ _validation = { - 'file_name': {'required': True}, 'media_link': {'required': True}, } _attribute_map = { - 'file_name': {'key': 'fileName', 'type': 'str'}, 'media_link': {'key': 'mediaLink', 'type': 'str'}, + 'default_configuration_link': {'key': 'defaultConfigurationLink', 'type': 'str'}, } def __init__( @@ -5924,8 +5961,8 @@ def __init__( **kwargs ): super(UserArtifactSource, self).__init__(**kwargs) - self.file_name = kwargs['file_name'] self.media_link = kwargs['media_link'] + self.default_configuration_link = kwargs.get('default_configuration_link', None) class UserAssignedIdentitiesValue(msrest.serialization.Model): diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/models/_models_py3.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/models/_models_py3.py index fdb9722539de..75cb44c41166 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/models/_models_py3.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/models/_models_py3.py @@ -2289,7 +2289,7 @@ class GalleryApplicationVersion(Resource): :type location: str :param tags: A set of tags. Resource tags. :type tags: dict[str, str] - :param publishing_profile: The publishing profile of a gallery Image Version. + :param publishing_profile: The publishing profile of a gallery image version. :type publishing_profile: ~azure.mgmt.compute.v2019_07_01.models.GalleryApplicationVersionPublishingProfile :ivar provisioning_state: The provisioning state, which only appears in the response. Possible @@ -2425,7 +2425,7 @@ def __init__( class GalleryApplicationVersionPublishingProfile(GalleryArtifactPublishingProfileBase): - """The publishing profile of a gallery Image Version. + """The publishing profile of a gallery image version. Variables are only populated by the server, and will be ignored when sending a request. @@ -2451,9 +2451,8 @@ class GalleryApplicationVersionPublishingProfile(GalleryArtifactPublishingProfil :type storage_account_type: str or ~azure.mgmt.compute.v2019_07_01.models.StorageAccountType :param source: Required. The source image from which the Image Version is going to be created. :type source: ~azure.mgmt.compute.v2019_07_01.models.UserArtifactSource - :param content_type: Optional. May be used to help process this file. The type of file - contained in the source, e.g. zip, json, etc. - :type content_type: str + :param manage_actions: + :type manage_actions: ~azure.mgmt.compute.v2019_07_01.models.UserArtifactManage :param enable_health_check: Optional. Whether or not this application reports health. :type enable_health_check: bool """ @@ -2471,7 +2470,7 @@ class GalleryApplicationVersionPublishingProfile(GalleryArtifactPublishingProfil 'end_of_life_date': {'key': 'endOfLifeDate', 'type': 'iso-8601'}, 'storage_account_type': {'key': 'storageAccountType', 'type': 'str'}, 'source': {'key': 'source', 'type': 'UserArtifactSource'}, - 'content_type': {'key': 'contentType', 'type': 'str'}, + 'manage_actions': {'key': 'manageActions', 'type': 'UserArtifactManage'}, 'enable_health_check': {'key': 'enableHealthCheck', 'type': 'bool'}, } @@ -2484,13 +2483,13 @@ def __init__( exclude_from_latest: Optional[bool] = None, end_of_life_date: Optional[datetime.datetime] = None, storage_account_type: Optional[Union[str, "StorageAccountType"]] = None, - content_type: Optional[str] = None, + manage_actions: Optional["UserArtifactManage"] = None, enable_health_check: Optional[bool] = None, **kwargs ): super(GalleryApplicationVersionPublishingProfile, self).__init__(target_regions=target_regions, replica_count=replica_count, exclude_from_latest=exclude_from_latest, end_of_life_date=end_of_life_date, storage_account_type=storage_account_type, **kwargs) self.source = source - self.content_type = content_type + self.manage_actions = manage_actions self.enable_health_check = enable_health_check @@ -2501,7 +2500,7 @@ class GalleryApplicationVersionUpdate(UpdateResource): :param tags: A set of tags. Resource tags. :type tags: dict[str, str] - :param publishing_profile: The publishing profile of a gallery Image Version. + :param publishing_profile: The publishing profile of a gallery image version. :type publishing_profile: ~azure.mgmt.compute.v2019_07_01.models.GalleryApplicationVersionPublishingProfile :ivar provisioning_state: The provisioning state, which only appears in the response. Possible @@ -6488,38 +6487,80 @@ def __init__( self.localized_value = localized_value +class UserArtifactManage(msrest.serialization.Model): + """UserArtifactManage. + + All required parameters must be populated in order to send to Azure. + + :param install: Required. Required. The path and arguments to install the gallery application. + This is limited to 4096 characters. + :type install: str + :param remove: Required. Required. The path and arguments to remove the gallery application. + This is limited to 4096 characters. + :type remove: str + :param update: Optional. The path and arguments to update the gallery application. If not + present, then update operation will invoke remove command on the previous version and install + command on the current version of the gallery application. This is limited to 4096 characters. + :type update: str + """ + + _validation = { + 'install': {'required': True}, + 'remove': {'required': True}, + } + + _attribute_map = { + 'install': {'key': 'install', 'type': 'str'}, + 'remove': {'key': 'remove', 'type': 'str'}, + 'update': {'key': 'update', 'type': 'str'}, + } + + def __init__( + self, + *, + install: str, + remove: str, + update: Optional[str] = None, + **kwargs + ): + super(UserArtifactManage, self).__init__(**kwargs) + self.install = install + self.remove = remove + self.update = update + + class UserArtifactSource(msrest.serialization.Model): """The source image from which the Image Version is going to be created. All required parameters must be populated in order to send to Azure. - :param file_name: Required. Required. The fileName of the artifact. - :type file_name: str :param media_link: Required. Required. The mediaLink of the artifact, must be a readable - storage blob. + storage page blob. :type media_link: str + :param default_configuration_link: Optional. The defaultConfigurationLink of the artifact, must + be a readable storage page blob. + :type default_configuration_link: str """ _validation = { - 'file_name': {'required': True}, 'media_link': {'required': True}, } _attribute_map = { - 'file_name': {'key': 'fileName', 'type': 'str'}, 'media_link': {'key': 'mediaLink', 'type': 'str'}, + 'default_configuration_link': {'key': 'defaultConfigurationLink', 'type': 'str'}, } def __init__( self, *, - file_name: str, media_link: str, + default_configuration_link: Optional[str] = None, **kwargs ): super(UserArtifactSource, self).__init__(**kwargs) - self.file_name = file_name self.media_link = media_link + self.default_configuration_link = default_configuration_link class UserAssignedIdentitiesValue(msrest.serialization.Model): diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_11_01/_compute_management_client.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_11_01/_compute_management_client.py index 637da39beaca..b926870da9fd 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_11_01/_compute_management_client.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_11_01/_compute_management_client.py @@ -56,7 +56,6 @@ def __init__( client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) - self._serialize.client_side_validation = False self._deserialize = Deserializer(client_models) self.disks = DisksOperations( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_11_01/_metadata.json b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_11_01/_metadata.json index 3740eeead9b0..e5a3c233cbb0 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_11_01/_metadata.json +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_11_01/_metadata.json @@ -9,7 +9,7 @@ "custom_base_url": null, "azure_arm": true, "has_lro_operations": true, - "client_side_validation": false + "client_side_validation": true }, "global_parameters": { "sync": { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_11_01/aio/_compute_management_client.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_11_01/aio/_compute_management_client.py index 896aa8817f96..6538d998cbe6 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_11_01/aio/_compute_management_client.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_11_01/aio/_compute_management_client.py @@ -53,7 +53,6 @@ def __init__( client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) - self._serialize.client_side_validation = False self._deserialize = Deserializer(client_models) self.disks = DisksOperations( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/_compute_management_client.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/_compute_management_client.py index 249869d97f82..0865646e071e 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/_compute_management_client.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/_compute_management_client.py @@ -122,7 +122,6 @@ def __init__( client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) - self._serialize.client_side_validation = False self._deserialize = Deserializer(client_models) self.operations = Operations( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/_metadata.json b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/_metadata.json index 8ed7cae0c24c..1b651386cea8 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/_metadata.json +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/_metadata.json @@ -9,7 +9,7 @@ "custom_base_url": null, "azure_arm": true, "has_lro_operations": true, - "client_side_validation": false + "client_side_validation": true }, "global_parameters": { "sync": { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/aio/_compute_management_client.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/aio/_compute_management_client.py index 8fca3e525bf8..a074d78092a4 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/aio/_compute_management_client.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/aio/_compute_management_client.py @@ -119,7 +119,6 @@ def __init__( client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) - self._serialize.client_side_validation = False self._deserialize = Deserializer(client_models) self.operations = Operations( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/models/__init__.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/models/__init__.py index c270d3b51252..cc5ac42515d4 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/models/__init__.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/models/__init__.py @@ -147,6 +147,7 @@ from ._models_py3 import UpgradePolicy from ._models_py3 import Usage from ._models_py3 import UsageName + from ._models_py3 import UserArtifactManage from ._models_py3 import UserArtifactSource from ._models_py3 import UserAssignedIdentitiesValue from ._models_py3 import VMScaleSetConvertToSinglePlacementGroupInput @@ -365,6 +366,7 @@ from ._models import UpgradePolicy # type: ignore from ._models import Usage # type: ignore from ._models import UsageName # type: ignore + from ._models import UserArtifactManage # type: ignore from ._models import UserArtifactSource # type: ignore from ._models import UserAssignedIdentitiesValue # type: ignore from ._models import VMScaleSetConvertToSinglePlacementGroupInput # type: ignore @@ -629,6 +631,7 @@ 'UpgradePolicy', 'Usage', 'UsageName', + 'UserArtifactManage', 'UserArtifactSource', 'UserAssignedIdentitiesValue', 'VMScaleSetConvertToSinglePlacementGroupInput', diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/models/_models.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/models/_models.py index 9a66882ad198..c91bc832c271 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/models/_models.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/models/_models.py @@ -1652,7 +1652,7 @@ class GalleryApplicationVersion(Resource): :type location: str :param tags: A set of tags. Resource tags. :type tags: dict[str, str] - :param publishing_profile: The publishing profile of a gallery Image Version. + :param publishing_profile: The publishing profile of a gallery image version. :type publishing_profile: ~azure.mgmt.compute.v2019_12_01.models.GalleryApplicationVersionPublishingProfile :ivar provisioning_state: The provisioning state, which only appears in the response. Possible @@ -1776,7 +1776,7 @@ def __init__( class GalleryApplicationVersionPublishingProfile(GalleryArtifactPublishingProfileBase): - """The publishing profile of a gallery Image Version. + """The publishing profile of a gallery image version. Variables are only populated by the server, and will be ignored when sending a request. @@ -1803,9 +1803,8 @@ class GalleryApplicationVersionPublishingProfile(GalleryArtifactPublishingProfil :type storage_account_type: str or ~azure.mgmt.compute.v2019_12_01.models.StorageAccountType :param source: Required. The source image from which the Image Version is going to be created. :type source: ~azure.mgmt.compute.v2019_12_01.models.UserArtifactSource - :param content_type: Optional. May be used to help process this file. The type of file - contained in the source, e.g. zip, json, etc. - :type content_type: str + :param manage_actions: + :type manage_actions: ~azure.mgmt.compute.v2019_12_01.models.UserArtifactManage :param enable_health_check: Optional. Whether or not this application reports health. :type enable_health_check: bool """ @@ -1823,7 +1822,7 @@ class GalleryApplicationVersionPublishingProfile(GalleryArtifactPublishingProfil 'end_of_life_date': {'key': 'endOfLifeDate', 'type': 'iso-8601'}, 'storage_account_type': {'key': 'storageAccountType', 'type': 'str'}, 'source': {'key': 'source', 'type': 'UserArtifactSource'}, - 'content_type': {'key': 'contentType', 'type': 'str'}, + 'manage_actions': {'key': 'manageActions', 'type': 'UserArtifactManage'}, 'enable_health_check': {'key': 'enableHealthCheck', 'type': 'bool'}, } @@ -1833,7 +1832,7 @@ def __init__( ): super(GalleryApplicationVersionPublishingProfile, self).__init__(**kwargs) self.source = kwargs['source'] - self.content_type = kwargs.get('content_type', None) + self.manage_actions = kwargs.get('manage_actions', None) self.enable_health_check = kwargs.get('enable_health_check', None) @@ -1850,7 +1849,7 @@ class GalleryApplicationVersionUpdate(UpdateResourceDefinition): :vartype type: str :param tags: A set of tags. Resource tags. :type tags: dict[str, str] - :param publishing_profile: The publishing profile of a gallery Image Version. + :param publishing_profile: The publishing profile of a gallery image version. :type publishing_profile: ~azure.mgmt.compute.v2019_12_01.models.GalleryApplicationVersionPublishingProfile :ivar provisioning_state: The provisioning state, which only appears in the response. Possible @@ -5395,26 +5394,64 @@ def __init__( self.localized_value = kwargs.get('localized_value', None) +class UserArtifactManage(msrest.serialization.Model): + """UserArtifactManage. + + All required parameters must be populated in order to send to Azure. + + :param install: Required. Required. The path and arguments to install the gallery application. + This is limited to 4096 characters. + :type install: str + :param remove: Required. Required. The path and arguments to remove the gallery application. + This is limited to 4096 characters. + :type remove: str + :param update: Optional. The path and arguments to update the gallery application. If not + present, then update operation will invoke remove command on the previous version and install + command on the current version of the gallery application. This is limited to 4096 characters. + :type update: str + """ + + _validation = { + 'install': {'required': True}, + 'remove': {'required': True}, + } + + _attribute_map = { + 'install': {'key': 'install', 'type': 'str'}, + 'remove': {'key': 'remove', 'type': 'str'}, + 'update': {'key': 'update', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(UserArtifactManage, self).__init__(**kwargs) + self.install = kwargs['install'] + self.remove = kwargs['remove'] + self.update = kwargs.get('update', None) + + class UserArtifactSource(msrest.serialization.Model): """The source image from which the Image Version is going to be created. All required parameters must be populated in order to send to Azure. - :param file_name: Required. Required. The fileName of the artifact. - :type file_name: str :param media_link: Required. Required. The mediaLink of the artifact, must be a readable - storage blob. + storage page blob. :type media_link: str + :param default_configuration_link: Optional. The defaultConfigurationLink of the artifact, must + be a readable storage page blob. + :type default_configuration_link: str """ _validation = { - 'file_name': {'required': True}, 'media_link': {'required': True}, } _attribute_map = { - 'file_name': {'key': 'fileName', 'type': 'str'}, 'media_link': {'key': 'mediaLink', 'type': 'str'}, + 'default_configuration_link': {'key': 'defaultConfigurationLink', 'type': 'str'}, } def __init__( @@ -5422,8 +5459,8 @@ def __init__( **kwargs ): super(UserArtifactSource, self).__init__(**kwargs) - self.file_name = kwargs['file_name'] self.media_link = kwargs['media_link'] + self.default_configuration_link = kwargs.get('default_configuration_link', None) class UserAssignedIdentitiesValue(msrest.serialization.Model): diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/models/_models_py3.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/models/_models_py3.py index 96ca84e142b9..74f50d4c0c7a 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/models/_models_py3.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/models/_models_py3.py @@ -1810,7 +1810,7 @@ class GalleryApplicationVersion(Resource): :type location: str :param tags: A set of tags. Resource tags. :type tags: dict[str, str] - :param publishing_profile: The publishing profile of a gallery Image Version. + :param publishing_profile: The publishing profile of a gallery image version. :type publishing_profile: ~azure.mgmt.compute.v2019_12_01.models.GalleryApplicationVersionPublishingProfile :ivar provisioning_state: The provisioning state, which only appears in the response. Possible @@ -1947,7 +1947,7 @@ def __init__( class GalleryApplicationVersionPublishingProfile(GalleryArtifactPublishingProfileBase): - """The publishing profile of a gallery Image Version. + """The publishing profile of a gallery image version. Variables are only populated by the server, and will be ignored when sending a request. @@ -1974,9 +1974,8 @@ class GalleryApplicationVersionPublishingProfile(GalleryArtifactPublishingProfil :type storage_account_type: str or ~azure.mgmt.compute.v2019_12_01.models.StorageAccountType :param source: Required. The source image from which the Image Version is going to be created. :type source: ~azure.mgmt.compute.v2019_12_01.models.UserArtifactSource - :param content_type: Optional. May be used to help process this file. The type of file - contained in the source, e.g. zip, json, etc. - :type content_type: str + :param manage_actions: + :type manage_actions: ~azure.mgmt.compute.v2019_12_01.models.UserArtifactManage :param enable_health_check: Optional. Whether or not this application reports health. :type enable_health_check: bool """ @@ -1994,7 +1993,7 @@ class GalleryApplicationVersionPublishingProfile(GalleryArtifactPublishingProfil 'end_of_life_date': {'key': 'endOfLifeDate', 'type': 'iso-8601'}, 'storage_account_type': {'key': 'storageAccountType', 'type': 'str'}, 'source': {'key': 'source', 'type': 'UserArtifactSource'}, - 'content_type': {'key': 'contentType', 'type': 'str'}, + 'manage_actions': {'key': 'manageActions', 'type': 'UserArtifactManage'}, 'enable_health_check': {'key': 'enableHealthCheck', 'type': 'bool'}, } @@ -2007,13 +2006,13 @@ def __init__( exclude_from_latest: Optional[bool] = None, end_of_life_date: Optional[datetime.datetime] = None, storage_account_type: Optional[Union[str, "StorageAccountType"]] = None, - content_type: Optional[str] = None, + manage_actions: Optional["UserArtifactManage"] = None, enable_health_check: Optional[bool] = None, **kwargs ): super(GalleryApplicationVersionPublishingProfile, self).__init__(target_regions=target_regions, replica_count=replica_count, exclude_from_latest=exclude_from_latest, end_of_life_date=end_of_life_date, storage_account_type=storage_account_type, **kwargs) self.source = source - self.content_type = content_type + self.manage_actions = manage_actions self.enable_health_check = enable_health_check @@ -2030,7 +2029,7 @@ class GalleryApplicationVersionUpdate(UpdateResourceDefinition): :vartype type: str :param tags: A set of tags. Resource tags. :type tags: dict[str, str] - :param publishing_profile: The publishing profile of a gallery Image Version. + :param publishing_profile: The publishing profile of a gallery image version. :type publishing_profile: ~azure.mgmt.compute.v2019_12_01.models.GalleryApplicationVersionPublishingProfile :ivar provisioning_state: The provisioning state, which only appears in the response. Possible @@ -5923,38 +5922,80 @@ def __init__( self.localized_value = localized_value +class UserArtifactManage(msrest.serialization.Model): + """UserArtifactManage. + + All required parameters must be populated in order to send to Azure. + + :param install: Required. Required. The path and arguments to install the gallery application. + This is limited to 4096 characters. + :type install: str + :param remove: Required. Required. The path and arguments to remove the gallery application. + This is limited to 4096 characters. + :type remove: str + :param update: Optional. The path and arguments to update the gallery application. If not + present, then update operation will invoke remove command on the previous version and install + command on the current version of the gallery application. This is limited to 4096 characters. + :type update: str + """ + + _validation = { + 'install': {'required': True}, + 'remove': {'required': True}, + } + + _attribute_map = { + 'install': {'key': 'install', 'type': 'str'}, + 'remove': {'key': 'remove', 'type': 'str'}, + 'update': {'key': 'update', 'type': 'str'}, + } + + def __init__( + self, + *, + install: str, + remove: str, + update: Optional[str] = None, + **kwargs + ): + super(UserArtifactManage, self).__init__(**kwargs) + self.install = install + self.remove = remove + self.update = update + + class UserArtifactSource(msrest.serialization.Model): """The source image from which the Image Version is going to be created. All required parameters must be populated in order to send to Azure. - :param file_name: Required. Required. The fileName of the artifact. - :type file_name: str :param media_link: Required. Required. The mediaLink of the artifact, must be a readable - storage blob. + storage page blob. :type media_link: str + :param default_configuration_link: Optional. The defaultConfigurationLink of the artifact, must + be a readable storage page blob. + :type default_configuration_link: str """ _validation = { - 'file_name': {'required': True}, 'media_link': {'required': True}, } _attribute_map = { - 'file_name': {'key': 'fileName', 'type': 'str'}, 'media_link': {'key': 'mediaLink', 'type': 'str'}, + 'default_configuration_link': {'key': 'defaultConfigurationLink', 'type': 'str'}, } def __init__( self, *, - file_name: str, media_link: str, + default_configuration_link: Optional[str] = None, **kwargs ): super(UserArtifactSource, self).__init__(**kwargs) - self.file_name = file_name self.media_link = media_link + self.default_configuration_link = default_configuration_link class UserAssignedIdentitiesValue(msrest.serialization.Model): diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_05_01/_compute_management_client.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_05_01/_compute_management_client.py index e4349e9e25cc..c77d74efa0e4 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_05_01/_compute_management_client.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_05_01/_compute_management_client.py @@ -59,7 +59,6 @@ def __init__( client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) - self._serialize.client_side_validation = False self._deserialize = Deserializer(client_models) self.disks = DisksOperations( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_05_01/_metadata.json b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_05_01/_metadata.json index 9901c4b73d0e..baa5352567dc 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_05_01/_metadata.json +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_05_01/_metadata.json @@ -9,7 +9,7 @@ "custom_base_url": null, "azure_arm": true, "has_lro_operations": true, - "client_side_validation": false + "client_side_validation": true }, "global_parameters": { "sync": { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_05_01/aio/_compute_management_client.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_05_01/aio/_compute_management_client.py index d0f08ca2041e..b2fb191fd399 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_05_01/aio/_compute_management_client.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_05_01/aio/_compute_management_client.py @@ -56,7 +56,6 @@ def __init__( client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) - self._serialize.client_side_validation = False self._deserialize = Deserializer(client_models) self.disks = DisksOperations( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/_compute_management_client.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/_compute_management_client.py index 7bc161f6c288..71348d9ef1c0 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/_compute_management_client.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/_compute_management_client.py @@ -110,7 +110,6 @@ def __init__( client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) - self._serialize.client_side_validation = False self._deserialize = Deserializer(client_models) self.operations = Operations( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/_metadata.json b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/_metadata.json index 2345523cc36e..2373304ad82d 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/_metadata.json +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/_metadata.json @@ -9,7 +9,7 @@ "custom_base_url": null, "azure_arm": true, "has_lro_operations": true, - "client_side_validation": false + "client_side_validation": true }, "global_parameters": { "sync": { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/aio/_compute_management_client.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/aio/_compute_management_client.py index 74fce5582858..07d80653cc48 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/aio/_compute_management_client.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/aio/_compute_management_client.py @@ -107,7 +107,6 @@ def __init__( client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) - self._serialize.client_side_validation = False self._deserialize = Deserializer(client_models) self.operations = Operations( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/aio/operations/_virtual_machines_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/aio/operations/_virtual_machines_operations.py index e476dbf7a894..d3b190a77b4f 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/aio/operations/_virtual_machines_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/aio/operations/_virtual_machines_operations.py @@ -555,7 +555,8 @@ async def begin_delete( :type resource_group_name: str :param vm_name: The name of the virtual machine. :type vm_name: str - :param force_deletion: Optional parameter to force delete virtual machines. + :param force_deletion: Optional parameter to force delete virtual machines.(Feature in + Preview). :type force_deletion: bool :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/models/_compute_management_client_enums.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/models/_compute_management_client_enums.py index 38ea852a0385..90a1603c26a4 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/models/_compute_management_client_enums.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/models/_compute_management_client_enums.py @@ -373,16 +373,20 @@ class VirtualMachineScaleSetSkuScaleType(with_metaclass(_CaseInsensitiveEnumMeta class VirtualMachineSizeTypes(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """Specifies the size of the virtual machine. For more information about virtual machine sizes, - see `Sizes for virtual machines `_. - :code:`
`:code:`
` The available VM sizes depend on region and availability set. For a - list of available sizes use these APIs: :code:`
`:code:`
` `List all available virtual - machine sizes in an availability set + see `Sizes for virtual machines `_. :code:`
`:code:`
` The available VM sizes depend on region and + availability set. For a list of available sizes use these APIs: :code:`
`:code:`
` `List + all available virtual machine sizes in an availability set `_ :code:`
`:code:`
` `List all available virtual machine sizes in a region - `_ + `_ :code:`
`:code:`
` `List all available virtual machine sizes for resizing - `_ + `_. + :code:`
`:code:`
` This list of sizes is no longer updated and the + **VirtualMachineSizeTypes** string constants will be removed from the subsequent REST API + specification. Use `List all available virtual machine sizes in a region + `_ to get the latest + sizes. """ BASIC_A0 = "Basic_A0" diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/models/_models.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/models/_models.py index 0d7419064dcb..33aa552bb865 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/models/_models.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/models/_models.py @@ -983,8 +983,8 @@ class DedicatedHostGroup(Resource): :param support_automatic_placement: Specifies whether virtual machines or virtual machine scale sets can be placed automatically on the dedicated host group. Automatic placement means resources are allocated on dedicated hosts, that are chosen by Azure, under the dedicated host - group. The value is defaulted to 'true' when not provided. :code:`
`:code:`
`Minimum api- - version: 2020-06-01. + group. The value is defaulted to 'false' when not provided. :code:`
`:code:`
`Minimum + api-version: 2020-06-01. :type support_automatic_placement: bool """ @@ -1093,8 +1093,8 @@ class DedicatedHostGroupUpdate(UpdateResource): :param support_automatic_placement: Specifies whether virtual machines or virtual machine scale sets can be placed automatically on the dedicated host group. Automatic placement means resources are allocated on dedicated hosts, that are chosen by Azure, under the dedicated host - group. The value is defaulted to 'true' when not provided. :code:`
`:code:`
`Minimum api- - version: 2020-06-01. + group. The value is defaulted to 'false' when not provided. :code:`
`:code:`
`Minimum + api-version: 2020-06-01. :type support_automatic_placement: bool """ @@ -1462,26 +1462,29 @@ class HardwareProfile(msrest.serialization.Model): """Specifies the hardware settings for the virtual machine. :param vm_size: Specifies the size of the virtual machine. For more information about virtual - machine sizes, see `Sizes for virtual machines `_. :code:`
`:code:`
` The available VM sizes depend on - region and availability set. For a list of available sizes use these APIs: - :code:`
`:code:`
` `List all available virtual machine sizes in an availability set + machine sizes, see `Sizes for virtual machines `_. :code:`
`:code:`
` The available VM sizes depend on region and + availability set. For a list of available sizes use these APIs: :code:`
`:code:`
` `List + all available virtual machine sizes in an availability set `_ :code:`
`:code:`
` `List all available virtual machine sizes in a region - `_ + `_ :code:`
`:code:`
` `List all available virtual machine sizes for resizing - `_. Possible - values include: "Basic_A0", "Basic_A1", "Basic_A2", "Basic_A3", "Basic_A4", "Standard_A0", - "Standard_A1", "Standard_A2", "Standard_A3", "Standard_A4", "Standard_A5", "Standard_A6", - "Standard_A7", "Standard_A8", "Standard_A9", "Standard_A10", "Standard_A11", "Standard_A1_v2", - "Standard_A2_v2", "Standard_A4_v2", "Standard_A8_v2", "Standard_A2m_v2", "Standard_A4m_v2", - "Standard_A8m_v2", "Standard_B1s", "Standard_B1ms", "Standard_B2s", "Standard_B2ms", - "Standard_B4ms", "Standard_B8ms", "Standard_D1", "Standard_D2", "Standard_D3", "Standard_D4", - "Standard_D11", "Standard_D12", "Standard_D13", "Standard_D14", "Standard_D1_v2", - "Standard_D2_v2", "Standard_D3_v2", "Standard_D4_v2", "Standard_D5_v2", "Standard_D2_v3", - "Standard_D4_v3", "Standard_D8_v3", "Standard_D16_v3", "Standard_D32_v3", "Standard_D64_v3", - "Standard_D2s_v3", "Standard_D4s_v3", "Standard_D8s_v3", "Standard_D16s_v3", + `_. + :code:`
`:code:`
` This list of sizes is no longer updated and the + **VirtualMachineSizeTypes** string constants will be removed from the subsequent REST API + specification. Use `List all available virtual machine sizes in a region + `_ to get the latest + sizes. Possible values include: "Basic_A0", "Basic_A1", "Basic_A2", "Basic_A3", "Basic_A4", + "Standard_A0", "Standard_A1", "Standard_A2", "Standard_A3", "Standard_A4", "Standard_A5", + "Standard_A6", "Standard_A7", "Standard_A8", "Standard_A9", "Standard_A10", "Standard_A11", + "Standard_A1_v2", "Standard_A2_v2", "Standard_A4_v2", "Standard_A8_v2", "Standard_A2m_v2", + "Standard_A4m_v2", "Standard_A8m_v2", "Standard_B1s", "Standard_B1ms", "Standard_B2s", + "Standard_B2ms", "Standard_B4ms", "Standard_B8ms", "Standard_D1", "Standard_D2", "Standard_D3", + "Standard_D4", "Standard_D11", "Standard_D12", "Standard_D13", "Standard_D14", + "Standard_D1_v2", "Standard_D2_v2", "Standard_D3_v2", "Standard_D4_v2", "Standard_D5_v2", + "Standard_D2_v3", "Standard_D4_v3", "Standard_D8_v3", "Standard_D16_v3", "Standard_D32_v3", + "Standard_D64_v3", "Standard_D2s_v3", "Standard_D4s_v3", "Standard_D8s_v3", "Standard_D16s_v3", "Standard_D32s_v3", "Standard_D64s_v3", "Standard_D11_v2", "Standard_D12_v2", "Standard_D13_v2", "Standard_D14_v2", "Standard_D15_v2", "Standard_DS1", "Standard_DS2", "Standard_DS3", "Standard_DS4", "Standard_DS11", "Standard_DS12", "Standard_DS13", @@ -2206,6 +2209,10 @@ class LogAnalyticsInputBase(msrest.serialization.Model): :type group_by_operation_name: bool :param group_by_resource_name: Group query result by Resource Name. :type group_by_resource_name: bool + :param group_by_client_application_id: Group query result by Client Application ID. + :type group_by_client_application_id: bool + :param group_by_user_agent: Group query result by User Agent. + :type group_by_user_agent: bool """ _validation = { @@ -2221,6 +2228,8 @@ class LogAnalyticsInputBase(msrest.serialization.Model): 'group_by_throttle_policy': {'key': 'groupByThrottlePolicy', 'type': 'bool'}, 'group_by_operation_name': {'key': 'groupByOperationName', 'type': 'bool'}, 'group_by_resource_name': {'key': 'groupByResourceName', 'type': 'bool'}, + 'group_by_client_application_id': {'key': 'groupByClientApplicationId', 'type': 'bool'}, + 'group_by_user_agent': {'key': 'groupByUserAgent', 'type': 'bool'}, } def __init__( @@ -2234,6 +2243,8 @@ def __init__( self.group_by_throttle_policy = kwargs.get('group_by_throttle_policy', None) self.group_by_operation_name = kwargs.get('group_by_operation_name', None) self.group_by_resource_name = kwargs.get('group_by_resource_name', None) + self.group_by_client_application_id = kwargs.get('group_by_client_application_id', None) + self.group_by_user_agent = kwargs.get('group_by_user_agent', None) class LogAnalyticsOperationResult(msrest.serialization.Model): @@ -2956,6 +2967,10 @@ class RequestRateByIntervalInput(LogAnalyticsInputBase): :type group_by_operation_name: bool :param group_by_resource_name: Group query result by Resource Name. :type group_by_resource_name: bool + :param group_by_client_application_id: Group query result by Client Application ID. + :type group_by_client_application_id: bool + :param group_by_user_agent: Group query result by User Agent. + :type group_by_user_agent: bool :param interval_length: Required. Interval value in minutes used to create LogAnalytics call rate logs. Possible values include: "ThreeMins", "FiveMins", "ThirtyMins", "SixtyMins". :type interval_length: str or ~azure.mgmt.compute.v2020_06_01.models.IntervalInMins @@ -2975,6 +2990,8 @@ class RequestRateByIntervalInput(LogAnalyticsInputBase): 'group_by_throttle_policy': {'key': 'groupByThrottlePolicy', 'type': 'bool'}, 'group_by_operation_name': {'key': 'groupByOperationName', 'type': 'bool'}, 'group_by_resource_name': {'key': 'groupByResourceName', 'type': 'bool'}, + 'group_by_client_application_id': {'key': 'groupByClientApplicationId', 'type': 'bool'}, + 'group_by_user_agent': {'key': 'groupByUserAgent', 'type': 'bool'}, 'interval_length': {'key': 'intervalLength', 'type': 'str'}, } @@ -3917,6 +3934,10 @@ class ThrottledRequestsInput(LogAnalyticsInputBase): :type group_by_operation_name: bool :param group_by_resource_name: Group query result by Resource Name. :type group_by_resource_name: bool + :param group_by_client_application_id: Group query result by Client Application ID. + :type group_by_client_application_id: bool + :param group_by_user_agent: Group query result by User Agent. + :type group_by_user_agent: bool """ _validation = { @@ -3932,6 +3953,8 @@ class ThrottledRequestsInput(LogAnalyticsInputBase): 'group_by_throttle_policy': {'key': 'groupByThrottlePolicy', 'type': 'bool'}, 'group_by_operation_name': {'key': 'groupByOperationName', 'type': 'bool'}, 'group_by_resource_name': {'key': 'groupByResourceName', 'type': 'bool'}, + 'group_by_client_application_id': {'key': 'groupByClientApplicationId', 'type': 'bool'}, + 'group_by_user_agent': {'key': 'groupByUserAgent', 'type': 'bool'}, } def __init__( @@ -6378,6 +6401,8 @@ class VirtualMachineScaleSetNetworkConfiguration(SubResource): :param enable_accelerated_networking: Specifies whether the network interface is accelerated networking-enabled. :type enable_accelerated_networking: bool + :param enable_fpga: Specifies whether the network interface is FPGA networking-enabled. + :type enable_fpga: bool :param network_security_group: The network security group. :type network_security_group: ~azure.mgmt.compute.v2020_06_01.models.SubResource :param dns_settings: The dns settings to be applied on the network interfaces. @@ -6399,6 +6424,7 @@ class VirtualMachineScaleSetNetworkConfiguration(SubResource): 'name': {'key': 'name', 'type': 'str'}, 'primary': {'key': 'properties.primary', 'type': 'bool'}, 'enable_accelerated_networking': {'key': 'properties.enableAcceleratedNetworking', 'type': 'bool'}, + 'enable_fpga': {'key': 'properties.enableFpga', 'type': 'bool'}, 'network_security_group': {'key': 'properties.networkSecurityGroup', 'type': 'SubResource'}, 'dns_settings': {'key': 'properties.dnsSettings', 'type': 'VirtualMachineScaleSetNetworkConfigurationDnsSettings'}, 'ip_configurations': {'key': 'properties.ipConfigurations', 'type': '[VirtualMachineScaleSetIPConfiguration]'}, @@ -6413,6 +6439,7 @@ def __init__( self.name = kwargs['name'] self.primary = kwargs.get('primary', None) self.enable_accelerated_networking = kwargs.get('enable_accelerated_networking', None) + self.enable_fpga = kwargs.get('enable_fpga', None) self.network_security_group = kwargs.get('network_security_group', None) self.dns_settings = kwargs.get('dns_settings', None) self.ip_configurations = kwargs.get('ip_configurations', None) @@ -6997,6 +7024,8 @@ class VirtualMachineScaleSetUpdateNetworkConfiguration(SubResource): :param enable_accelerated_networking: Specifies whether the network interface is accelerated networking-enabled. :type enable_accelerated_networking: bool + :param enable_fpga: Specifies whether the network interface is FPGA networking-enabled. + :type enable_fpga: bool :param network_security_group: The network security group. :type network_security_group: ~azure.mgmt.compute.v2020_06_01.models.SubResource :param dns_settings: The dns settings to be applied on the network interfaces. @@ -7014,6 +7043,7 @@ class VirtualMachineScaleSetUpdateNetworkConfiguration(SubResource): 'name': {'key': 'name', 'type': 'str'}, 'primary': {'key': 'properties.primary', 'type': 'bool'}, 'enable_accelerated_networking': {'key': 'properties.enableAcceleratedNetworking', 'type': 'bool'}, + 'enable_fpga': {'key': 'properties.enableFpga', 'type': 'bool'}, 'network_security_group': {'key': 'properties.networkSecurityGroup', 'type': 'SubResource'}, 'dns_settings': {'key': 'properties.dnsSettings', 'type': 'VirtualMachineScaleSetNetworkConfigurationDnsSettings'}, 'ip_configurations': {'key': 'properties.ipConfigurations', 'type': '[VirtualMachineScaleSetUpdateIPConfiguration]'}, @@ -7028,6 +7058,7 @@ def __init__( self.name = kwargs.get('name', None) self.primary = kwargs.get('primary', None) self.enable_accelerated_networking = kwargs.get('enable_accelerated_networking', None) + self.enable_fpga = kwargs.get('enable_fpga', None) self.network_security_group = kwargs.get('network_security_group', None) self.dns_settings = kwargs.get('dns_settings', None) self.ip_configurations = kwargs.get('ip_configurations', None) diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/models/_models_py3.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/models/_models_py3.py index 6ebcf3eededd..5c16c5de040a 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/models/_models_py3.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/models/_models_py3.py @@ -1064,8 +1064,8 @@ class DedicatedHostGroup(Resource): :param support_automatic_placement: Specifies whether virtual machines or virtual machine scale sets can be placed automatically on the dedicated host group. Automatic placement means resources are allocated on dedicated hosts, that are chosen by Azure, under the dedicated host - group. The value is defaulted to 'true' when not provided. :code:`
`:code:`
`Minimum api- - version: 2020-06-01. + group. The value is defaulted to 'false' when not provided. :code:`
`:code:`
`Minimum + api-version: 2020-06-01. :type support_automatic_placement: bool """ @@ -1185,8 +1185,8 @@ class DedicatedHostGroupUpdate(UpdateResource): :param support_automatic_placement: Specifies whether virtual machines or virtual machine scale sets can be placed automatically on the dedicated host group. Automatic placement means resources are allocated on dedicated hosts, that are chosen by Azure, under the dedicated host - group. The value is defaulted to 'true' when not provided. :code:`
`:code:`
`Minimum api- - version: 2020-06-01. + group. The value is defaulted to 'false' when not provided. :code:`
`:code:`
`Minimum + api-version: 2020-06-01. :type support_automatic_placement: bool """ @@ -1592,26 +1592,29 @@ class HardwareProfile(msrest.serialization.Model): """Specifies the hardware settings for the virtual machine. :param vm_size: Specifies the size of the virtual machine. For more information about virtual - machine sizes, see `Sizes for virtual machines `_. :code:`
`:code:`
` The available VM sizes depend on - region and availability set. For a list of available sizes use these APIs: - :code:`
`:code:`
` `List all available virtual machine sizes in an availability set + machine sizes, see `Sizes for virtual machines `_. :code:`
`:code:`
` The available VM sizes depend on region and + availability set. For a list of available sizes use these APIs: :code:`
`:code:`
` `List + all available virtual machine sizes in an availability set `_ :code:`
`:code:`
` `List all available virtual machine sizes in a region - `_ + `_ :code:`
`:code:`
` `List all available virtual machine sizes for resizing - `_. Possible - values include: "Basic_A0", "Basic_A1", "Basic_A2", "Basic_A3", "Basic_A4", "Standard_A0", - "Standard_A1", "Standard_A2", "Standard_A3", "Standard_A4", "Standard_A5", "Standard_A6", - "Standard_A7", "Standard_A8", "Standard_A9", "Standard_A10", "Standard_A11", "Standard_A1_v2", - "Standard_A2_v2", "Standard_A4_v2", "Standard_A8_v2", "Standard_A2m_v2", "Standard_A4m_v2", - "Standard_A8m_v2", "Standard_B1s", "Standard_B1ms", "Standard_B2s", "Standard_B2ms", - "Standard_B4ms", "Standard_B8ms", "Standard_D1", "Standard_D2", "Standard_D3", "Standard_D4", - "Standard_D11", "Standard_D12", "Standard_D13", "Standard_D14", "Standard_D1_v2", - "Standard_D2_v2", "Standard_D3_v2", "Standard_D4_v2", "Standard_D5_v2", "Standard_D2_v3", - "Standard_D4_v3", "Standard_D8_v3", "Standard_D16_v3", "Standard_D32_v3", "Standard_D64_v3", - "Standard_D2s_v3", "Standard_D4s_v3", "Standard_D8s_v3", "Standard_D16s_v3", + `_. + :code:`
`:code:`
` This list of sizes is no longer updated and the + **VirtualMachineSizeTypes** string constants will be removed from the subsequent REST API + specification. Use `List all available virtual machine sizes in a region + `_ to get the latest + sizes. Possible values include: "Basic_A0", "Basic_A1", "Basic_A2", "Basic_A3", "Basic_A4", + "Standard_A0", "Standard_A1", "Standard_A2", "Standard_A3", "Standard_A4", "Standard_A5", + "Standard_A6", "Standard_A7", "Standard_A8", "Standard_A9", "Standard_A10", "Standard_A11", + "Standard_A1_v2", "Standard_A2_v2", "Standard_A4_v2", "Standard_A8_v2", "Standard_A2m_v2", + "Standard_A4m_v2", "Standard_A8m_v2", "Standard_B1s", "Standard_B1ms", "Standard_B2s", + "Standard_B2ms", "Standard_B4ms", "Standard_B8ms", "Standard_D1", "Standard_D2", "Standard_D3", + "Standard_D4", "Standard_D11", "Standard_D12", "Standard_D13", "Standard_D14", + "Standard_D1_v2", "Standard_D2_v2", "Standard_D3_v2", "Standard_D4_v2", "Standard_D5_v2", + "Standard_D2_v3", "Standard_D4_v3", "Standard_D8_v3", "Standard_D16_v3", "Standard_D32_v3", + "Standard_D64_v3", "Standard_D2s_v3", "Standard_D4s_v3", "Standard_D8s_v3", "Standard_D16s_v3", "Standard_D32s_v3", "Standard_D64s_v3", "Standard_D11_v2", "Standard_D12_v2", "Standard_D13_v2", "Standard_D14_v2", "Standard_D15_v2", "Standard_DS1", "Standard_DS2", "Standard_DS3", "Standard_DS4", "Standard_DS11", "Standard_DS12", "Standard_DS13", @@ -2411,6 +2414,10 @@ class LogAnalyticsInputBase(msrest.serialization.Model): :type group_by_operation_name: bool :param group_by_resource_name: Group query result by Resource Name. :type group_by_resource_name: bool + :param group_by_client_application_id: Group query result by Client Application ID. + :type group_by_client_application_id: bool + :param group_by_user_agent: Group query result by User Agent. + :type group_by_user_agent: bool """ _validation = { @@ -2426,6 +2433,8 @@ class LogAnalyticsInputBase(msrest.serialization.Model): 'group_by_throttle_policy': {'key': 'groupByThrottlePolicy', 'type': 'bool'}, 'group_by_operation_name': {'key': 'groupByOperationName', 'type': 'bool'}, 'group_by_resource_name': {'key': 'groupByResourceName', 'type': 'bool'}, + 'group_by_client_application_id': {'key': 'groupByClientApplicationId', 'type': 'bool'}, + 'group_by_user_agent': {'key': 'groupByUserAgent', 'type': 'bool'}, } def __init__( @@ -2437,6 +2446,8 @@ def __init__( group_by_throttle_policy: Optional[bool] = None, group_by_operation_name: Optional[bool] = None, group_by_resource_name: Optional[bool] = None, + group_by_client_application_id: Optional[bool] = None, + group_by_user_agent: Optional[bool] = None, **kwargs ): super(LogAnalyticsInputBase, self).__init__(**kwargs) @@ -2446,6 +2457,8 @@ def __init__( self.group_by_throttle_policy = group_by_throttle_policy self.group_by_operation_name = group_by_operation_name self.group_by_resource_name = group_by_resource_name + self.group_by_client_application_id = group_by_client_application_id + self.group_by_user_agent = group_by_user_agent class LogAnalyticsOperationResult(msrest.serialization.Model): @@ -3233,6 +3246,10 @@ class RequestRateByIntervalInput(LogAnalyticsInputBase): :type group_by_operation_name: bool :param group_by_resource_name: Group query result by Resource Name. :type group_by_resource_name: bool + :param group_by_client_application_id: Group query result by Client Application ID. + :type group_by_client_application_id: bool + :param group_by_user_agent: Group query result by User Agent. + :type group_by_user_agent: bool :param interval_length: Required. Interval value in minutes used to create LogAnalytics call rate logs. Possible values include: "ThreeMins", "FiveMins", "ThirtyMins", "SixtyMins". :type interval_length: str or ~azure.mgmt.compute.v2020_06_01.models.IntervalInMins @@ -3252,6 +3269,8 @@ class RequestRateByIntervalInput(LogAnalyticsInputBase): 'group_by_throttle_policy': {'key': 'groupByThrottlePolicy', 'type': 'bool'}, 'group_by_operation_name': {'key': 'groupByOperationName', 'type': 'bool'}, 'group_by_resource_name': {'key': 'groupByResourceName', 'type': 'bool'}, + 'group_by_client_application_id': {'key': 'groupByClientApplicationId', 'type': 'bool'}, + 'group_by_user_agent': {'key': 'groupByUserAgent', 'type': 'bool'}, 'interval_length': {'key': 'intervalLength', 'type': 'str'}, } @@ -3265,9 +3284,11 @@ def __init__( group_by_throttle_policy: Optional[bool] = None, group_by_operation_name: Optional[bool] = None, group_by_resource_name: Optional[bool] = None, + group_by_client_application_id: Optional[bool] = None, + group_by_user_agent: Optional[bool] = None, **kwargs ): - super(RequestRateByIntervalInput, self).__init__(blob_container_sas_uri=blob_container_sas_uri, from_time=from_time, to_time=to_time, group_by_throttle_policy=group_by_throttle_policy, group_by_operation_name=group_by_operation_name, group_by_resource_name=group_by_resource_name, **kwargs) + super(RequestRateByIntervalInput, self).__init__(blob_container_sas_uri=blob_container_sas_uri, from_time=from_time, to_time=to_time, group_by_throttle_policy=group_by_throttle_policy, group_by_operation_name=group_by_operation_name, group_by_resource_name=group_by_resource_name, group_by_client_application_id=group_by_client_application_id, group_by_user_agent=group_by_user_agent, **kwargs) self.interval_length = interval_length @@ -4280,6 +4301,10 @@ class ThrottledRequestsInput(LogAnalyticsInputBase): :type group_by_operation_name: bool :param group_by_resource_name: Group query result by Resource Name. :type group_by_resource_name: bool + :param group_by_client_application_id: Group query result by Client Application ID. + :type group_by_client_application_id: bool + :param group_by_user_agent: Group query result by User Agent. + :type group_by_user_agent: bool """ _validation = { @@ -4295,6 +4320,8 @@ class ThrottledRequestsInput(LogAnalyticsInputBase): 'group_by_throttle_policy': {'key': 'groupByThrottlePolicy', 'type': 'bool'}, 'group_by_operation_name': {'key': 'groupByOperationName', 'type': 'bool'}, 'group_by_resource_name': {'key': 'groupByResourceName', 'type': 'bool'}, + 'group_by_client_application_id': {'key': 'groupByClientApplicationId', 'type': 'bool'}, + 'group_by_user_agent': {'key': 'groupByUserAgent', 'type': 'bool'}, } def __init__( @@ -4306,9 +4333,11 @@ def __init__( group_by_throttle_policy: Optional[bool] = None, group_by_operation_name: Optional[bool] = None, group_by_resource_name: Optional[bool] = None, + group_by_client_application_id: Optional[bool] = None, + group_by_user_agent: Optional[bool] = None, **kwargs ): - super(ThrottledRequestsInput, self).__init__(blob_container_sas_uri=blob_container_sas_uri, from_time=from_time, to_time=to_time, group_by_throttle_policy=group_by_throttle_policy, group_by_operation_name=group_by_operation_name, group_by_resource_name=group_by_resource_name, **kwargs) + super(ThrottledRequestsInput, self).__init__(blob_container_sas_uri=blob_container_sas_uri, from_time=from_time, to_time=to_time, group_by_throttle_policy=group_by_throttle_policy, group_by_operation_name=group_by_operation_name, group_by_resource_name=group_by_resource_name, group_by_client_application_id=group_by_client_application_id, group_by_user_agent=group_by_user_agent, **kwargs) class UpgradeOperationHistoricalStatusInfo(msrest.serialization.Model): @@ -7013,6 +7042,8 @@ class VirtualMachineScaleSetNetworkConfiguration(SubResource): :param enable_accelerated_networking: Specifies whether the network interface is accelerated networking-enabled. :type enable_accelerated_networking: bool + :param enable_fpga: Specifies whether the network interface is FPGA networking-enabled. + :type enable_fpga: bool :param network_security_group: The network security group. :type network_security_group: ~azure.mgmt.compute.v2020_06_01.models.SubResource :param dns_settings: The dns settings to be applied on the network interfaces. @@ -7034,6 +7065,7 @@ class VirtualMachineScaleSetNetworkConfiguration(SubResource): 'name': {'key': 'name', 'type': 'str'}, 'primary': {'key': 'properties.primary', 'type': 'bool'}, 'enable_accelerated_networking': {'key': 'properties.enableAcceleratedNetworking', 'type': 'bool'}, + 'enable_fpga': {'key': 'properties.enableFpga', 'type': 'bool'}, 'network_security_group': {'key': 'properties.networkSecurityGroup', 'type': 'SubResource'}, 'dns_settings': {'key': 'properties.dnsSettings', 'type': 'VirtualMachineScaleSetNetworkConfigurationDnsSettings'}, 'ip_configurations': {'key': 'properties.ipConfigurations', 'type': '[VirtualMachineScaleSetIPConfiguration]'}, @@ -7047,6 +7079,7 @@ def __init__( id: Optional[str] = None, primary: Optional[bool] = None, enable_accelerated_networking: Optional[bool] = None, + enable_fpga: Optional[bool] = None, network_security_group: Optional["SubResource"] = None, dns_settings: Optional["VirtualMachineScaleSetNetworkConfigurationDnsSettings"] = None, ip_configurations: Optional[List["VirtualMachineScaleSetIPConfiguration"]] = None, @@ -7057,6 +7090,7 @@ def __init__( self.name = name self.primary = primary self.enable_accelerated_networking = enable_accelerated_networking + self.enable_fpga = enable_fpga self.network_security_group = network_security_group self.dns_settings = dns_settings self.ip_configurations = ip_configurations @@ -7706,6 +7740,8 @@ class VirtualMachineScaleSetUpdateNetworkConfiguration(SubResource): :param enable_accelerated_networking: Specifies whether the network interface is accelerated networking-enabled. :type enable_accelerated_networking: bool + :param enable_fpga: Specifies whether the network interface is FPGA networking-enabled. + :type enable_fpga: bool :param network_security_group: The network security group. :type network_security_group: ~azure.mgmt.compute.v2020_06_01.models.SubResource :param dns_settings: The dns settings to be applied on the network interfaces. @@ -7723,6 +7759,7 @@ class VirtualMachineScaleSetUpdateNetworkConfiguration(SubResource): 'name': {'key': 'name', 'type': 'str'}, 'primary': {'key': 'properties.primary', 'type': 'bool'}, 'enable_accelerated_networking': {'key': 'properties.enableAcceleratedNetworking', 'type': 'bool'}, + 'enable_fpga': {'key': 'properties.enableFpga', 'type': 'bool'}, 'network_security_group': {'key': 'properties.networkSecurityGroup', 'type': 'SubResource'}, 'dns_settings': {'key': 'properties.dnsSettings', 'type': 'VirtualMachineScaleSetNetworkConfigurationDnsSettings'}, 'ip_configurations': {'key': 'properties.ipConfigurations', 'type': '[VirtualMachineScaleSetUpdateIPConfiguration]'}, @@ -7736,6 +7773,7 @@ def __init__( name: Optional[str] = None, primary: Optional[bool] = None, enable_accelerated_networking: Optional[bool] = None, + enable_fpga: Optional[bool] = None, network_security_group: Optional["SubResource"] = None, dns_settings: Optional["VirtualMachineScaleSetNetworkConfigurationDnsSettings"] = None, ip_configurations: Optional[List["VirtualMachineScaleSetUpdateIPConfiguration"]] = None, @@ -7746,6 +7784,7 @@ def __init__( self.name = name self.primary = primary self.enable_accelerated_networking = enable_accelerated_networking + self.enable_fpga = enable_fpga self.network_security_group = network_security_group self.dns_settings = dns_settings self.ip_configurations = ip_configurations diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/operations/_virtual_machines_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/operations/_virtual_machines_operations.py index e9d4968ec53d..31e3368b532b 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/operations/_virtual_machines_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/operations/_virtual_machines_operations.py @@ -568,7 +568,8 @@ def begin_delete( :type resource_group_name: str :param vm_name: The name of the virtual machine. :type vm_name: str - :param force_deletion: Optional parameter to force delete virtual machines. + :param force_deletion: Optional parameter to force delete virtual machines.(Feature in + Preview). :type force_deletion: bool :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_30/_compute_management_client.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_30/_compute_management_client.py index 4fd16125d667..bba4e5b777ed 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_30/_compute_management_client.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_30/_compute_management_client.py @@ -59,7 +59,6 @@ def __init__( client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) - self._serialize.client_side_validation = False self._deserialize = Deserializer(client_models) self.disks = DisksOperations( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_30/_metadata.json b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_30/_metadata.json index be6798853d05..5a3d45cb2324 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_30/_metadata.json +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_30/_metadata.json @@ -9,7 +9,7 @@ "custom_base_url": null, "azure_arm": true, "has_lro_operations": true, - "client_side_validation": false + "client_side_validation": true }, "global_parameters": { "sync": { diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_30/aio/_compute_management_client.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_30/aio/_compute_management_client.py index 06ad146f3eb1..2223a7099bf8 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_30/aio/_compute_management_client.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_30/aio/_compute_management_client.py @@ -56,7 +56,6 @@ def __init__( client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) - self._serialize.client_side_validation = False self._deserialize = Deserializer(client_models) self.disks = DisksOperations( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_09_30/_compute_management_client.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_09_30/_compute_management_client.py index b11030f38cd5..2c54d9a986af 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_09_30/_compute_management_client.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_09_30/_compute_management_client.py @@ -18,6 +18,11 @@ from azure.core.credentials import TokenCredential from ._configuration import ComputeManagementClientConfiguration +from .operations import DisksOperations +from .operations import SnapshotsOperations +from .operations import DiskEncryptionSetsOperations +from .operations import DiskAccessesOperations +from .operations import DiskRestorePointOperations from .operations import GalleriesOperations from .operations import GalleryImagesOperations from .operations import GalleryImageVersionsOperations @@ -33,6 +38,16 @@ class ComputeManagementClient(object): """Compute Client. + :ivar disks: DisksOperations operations + :vartype disks: azure.mgmt.compute.v2020_09_30.operations.DisksOperations + :ivar snapshots: SnapshotsOperations operations + :vartype snapshots: azure.mgmt.compute.v2020_09_30.operations.SnapshotsOperations + :ivar disk_encryption_sets: DiskEncryptionSetsOperations operations + :vartype disk_encryption_sets: azure.mgmt.compute.v2020_09_30.operations.DiskEncryptionSetsOperations + :ivar disk_accesses: DiskAccessesOperations operations + :vartype disk_accesses: azure.mgmt.compute.v2020_09_30.operations.DiskAccessesOperations + :ivar disk_restore_point: DiskRestorePointOperations operations + :vartype disk_restore_point: azure.mgmt.compute.v2020_09_30.operations.DiskRestorePointOperations :ivar galleries: GalleriesOperations operations :vartype galleries: azure.mgmt.compute.v2020_09_30.operations.GalleriesOperations :ivar gallery_images: GalleryImagesOperations operations @@ -74,9 +89,18 @@ def __init__( client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) - self._serialize.client_side_validation = False self._deserialize = Deserializer(client_models) + self.disks = DisksOperations( + self._client, self._config, self._serialize, self._deserialize) + self.snapshots = SnapshotsOperations( + self._client, self._config, self._serialize, self._deserialize) + self.disk_encryption_sets = DiskEncryptionSetsOperations( + self._client, self._config, self._serialize, self._deserialize) + self.disk_accesses = DiskAccessesOperations( + self._client, self._config, self._serialize, self._deserialize) + self.disk_restore_point = DiskRestorePointOperations( + self._client, self._config, self._serialize, self._deserialize) self.galleries = GalleriesOperations( self._client, self._config, self._serialize, self._deserialize) self.gallery_images = GalleryImagesOperations( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_09_30/_metadata.json b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_09_30/_metadata.json index d8f99bc1e13a..664819cd79b0 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_09_30/_metadata.json +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_09_30/_metadata.json @@ -9,7 +9,7 @@ "custom_base_url": null, "azure_arm": true, "has_lro_operations": true, - "client_side_validation": false + "client_side_validation": true }, "global_parameters": { "sync": { @@ -52,6 +52,11 @@ "credential_key_header_name": null }, "operation_groups": { + "disks": "DisksOperations", + "snapshots": "SnapshotsOperations", + "disk_encryption_sets": "DiskEncryptionSetsOperations", + "disk_accesses": "DiskAccessesOperations", + "disk_restore_point": "DiskRestorePointOperations", "galleries": "GalleriesOperations", "gallery_images": "GalleryImagesOperations", "gallery_image_versions": "GalleryImageVersionsOperations", diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_09_30/aio/_compute_management_client.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_09_30/aio/_compute_management_client.py index a1a696a8e55c..e3bfba6d14a2 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_09_30/aio/_compute_management_client.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_09_30/aio/_compute_management_client.py @@ -16,6 +16,11 @@ from azure.core.credentials_async import AsyncTokenCredential from ._configuration import ComputeManagementClientConfiguration +from .operations import DisksOperations +from .operations import SnapshotsOperations +from .operations import DiskEncryptionSetsOperations +from .operations import DiskAccessesOperations +from .operations import DiskRestorePointOperations from .operations import GalleriesOperations from .operations import GalleryImagesOperations from .operations import GalleryImageVersionsOperations @@ -31,6 +36,16 @@ class ComputeManagementClient(object): """Compute Client. + :ivar disks: DisksOperations operations + :vartype disks: azure.mgmt.compute.v2020_09_30.aio.operations.DisksOperations + :ivar snapshots: SnapshotsOperations operations + :vartype snapshots: azure.mgmt.compute.v2020_09_30.aio.operations.SnapshotsOperations + :ivar disk_encryption_sets: DiskEncryptionSetsOperations operations + :vartype disk_encryption_sets: azure.mgmt.compute.v2020_09_30.aio.operations.DiskEncryptionSetsOperations + :ivar disk_accesses: DiskAccessesOperations operations + :vartype disk_accesses: azure.mgmt.compute.v2020_09_30.aio.operations.DiskAccessesOperations + :ivar disk_restore_point: DiskRestorePointOperations operations + :vartype disk_restore_point: azure.mgmt.compute.v2020_09_30.aio.operations.DiskRestorePointOperations :ivar galleries: GalleriesOperations operations :vartype galleries: azure.mgmt.compute.v2020_09_30.aio.operations.GalleriesOperations :ivar gallery_images: GalleryImagesOperations operations @@ -71,9 +86,18 @@ def __init__( client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) - self._serialize.client_side_validation = False self._deserialize = Deserializer(client_models) + self.disks = DisksOperations( + self._client, self._config, self._serialize, self._deserialize) + self.snapshots = SnapshotsOperations( + self._client, self._config, self._serialize, self._deserialize) + self.disk_encryption_sets = DiskEncryptionSetsOperations( + self._client, self._config, self._serialize, self._deserialize) + self.disk_accesses = DiskAccessesOperations( + self._client, self._config, self._serialize, self._deserialize) + self.disk_restore_point = DiskRestorePointOperations( + self._client, self._config, self._serialize, self._deserialize) self.galleries = GalleriesOperations( self._client, self._config, self._serialize, self._deserialize) self.gallery_images = GalleryImagesOperations( diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_09_30/aio/operations/__init__.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_09_30/aio/operations/__init__.py index 2999cc9432ab..fa8761318cfa 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_09_30/aio/operations/__init__.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_09_30/aio/operations/__init__.py @@ -6,6 +6,11 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +from ._disks_operations import DisksOperations +from ._snapshots_operations import SnapshotsOperations +from ._disk_encryption_sets_operations import DiskEncryptionSetsOperations +from ._disk_accesses_operations import DiskAccessesOperations +from ._disk_restore_point_operations import DiskRestorePointOperations from ._galleries_operations import GalleriesOperations from ._gallery_images_operations import GalleryImagesOperations from ._gallery_image_versions_operations import GalleryImageVersionsOperations @@ -17,6 +22,11 @@ from ._shared_gallery_image_versions_operations import SharedGalleryImageVersionsOperations __all__ = [ + 'DisksOperations', + 'SnapshotsOperations', + 'DiskEncryptionSetsOperations', + 'DiskAccessesOperations', + 'DiskRestorePointOperations', 'GalleriesOperations', 'GalleryImagesOperations', 'GalleryImageVersionsOperations', diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_09_30/aio/operations/_disk_accesses_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_09_30/aio/operations/_disk_accesses_operations.py new file mode 100644 index 000000000000..42938d4f0092 --- /dev/null +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_09_30/aio/operations/_disk_accesses_operations.py @@ -0,0 +1,1066 @@ +# 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 typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling + +from ... import models as _models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class DiskAccessesOperations: + """DiskAccessesOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.compute.v2020_09_30.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + async def _create_or_update_initial( + self, + resource_group_name: str, + disk_access_name: str, + disk_access: "_models.DiskAccess", + **kwargs + ) -> "_models.DiskAccess": + cls = kwargs.pop('cls', None) # type: ClsType["_models.DiskAccess"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-30" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._create_or_update_initial.metadata['url'] # type: ignore + 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'), + 'diskAccessName': self._serialize.url("disk_access_name", disk_access_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(disk_access, 'DiskAccess') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('DiskAccess', pipeline_response) + + if response.status_code == 202: + deserialized = self._deserialize('DiskAccess', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskAccesses/{diskAccessName}'} # type: ignore + + async def begin_create_or_update( + self, + resource_group_name: str, + disk_access_name: str, + disk_access: "_models.DiskAccess", + **kwargs + ) -> AsyncLROPoller["_models.DiskAccess"]: + """Creates or updates a disk access resource. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param disk_access_name: The name of the disk access resource that is being created. The name + can't be changed after the disk encryption set is created. Supported characters for the name + are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. + :type disk_access_name: str + :param disk_access: disk access object supplied in the body of the Put disk access operation. + :type disk_access: ~azure.mgmt.compute.v2020_09_30.models.DiskAccess + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either DiskAccess or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2020_09_30.models.DiskAccess] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DiskAccess"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._create_or_update_initial( + resource_group_name=resource_group_name, + disk_access_name=disk_access_name, + disk_access=disk_access, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('DiskAccess', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + 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'), + 'diskAccessName': self._serialize.url("disk_access_name", disk_access_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskAccesses/{diskAccessName}'} # type: ignore + + async def _update_initial( + self, + resource_group_name: str, + disk_access_name: str, + disk_access: "_models.DiskAccessUpdate", + **kwargs + ) -> "_models.DiskAccess": + cls = kwargs.pop('cls', None) # type: ClsType["_models.DiskAccess"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-30" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._update_initial.metadata['url'] # type: ignore + 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'), + 'diskAccessName': self._serialize.url("disk_access_name", disk_access_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(disk_access, 'DiskAccessUpdate') + body_content_kwargs['content'] = body_content + request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('DiskAccess', pipeline_response) + + if response.status_code == 202: + deserialized = self._deserialize('DiskAccess', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskAccesses/{diskAccessName}'} # type: ignore + + async def begin_update( + self, + resource_group_name: str, + disk_access_name: str, + disk_access: "_models.DiskAccessUpdate", + **kwargs + ) -> AsyncLROPoller["_models.DiskAccess"]: + """Updates (patches) a disk access resource. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param disk_access_name: The name of the disk access resource that is being created. The name + can't be changed after the disk encryption set is created. Supported characters for the name + are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. + :type disk_access_name: str + :param disk_access: disk access object supplied in the body of the Patch disk access operation. + :type disk_access: ~azure.mgmt.compute.v2020_09_30.models.DiskAccessUpdate + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either DiskAccess or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2020_09_30.models.DiskAccess] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DiskAccess"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._update_initial( + resource_group_name=resource_group_name, + disk_access_name=disk_access_name, + disk_access=disk_access, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('DiskAccess', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + 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'), + 'diskAccessName': self._serialize.url("disk_access_name", disk_access_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskAccesses/{diskAccessName}'} # type: ignore + + async def get( + self, + resource_group_name: str, + disk_access_name: str, + **kwargs + ) -> "_models.DiskAccess": + """Gets information about a disk access resource. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param disk_access_name: The name of the disk access resource that is being created. The name + can't be changed after the disk encryption set is created. Supported characters for the name + are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. + :type disk_access_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: DiskAccess, or the result of cls(response) + :rtype: ~azure.mgmt.compute.v2020_09_30.models.DiskAccess + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.DiskAccess"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-30" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + 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'), + 'diskAccessName': self._serialize.url("disk_access_name", disk_access_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('DiskAccess', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskAccesses/{diskAccessName}'} # type: ignore + + async def _delete_initial( + self, + resource_group_name: str, + disk_access_name: str, + **kwargs + ) -> None: + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-30" + accept = "application/json" + + # Construct URL + url = self._delete_initial.metadata['url'] # type: ignore + 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'), + 'diskAccessName': self._serialize.url("disk_access_name", disk_access_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskAccesses/{diskAccessName}'} # type: ignore + + async def begin_delete( + self, + resource_group_name: str, + disk_access_name: str, + **kwargs + ) -> AsyncLROPoller[None]: + """Deletes a disk access resource. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param disk_access_name: The name of the disk access resource that is being created. The name + can't be changed after the disk encryption set is created. Supported characters for the name + are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. + :type disk_access_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._delete_initial( + resource_group_name=resource_group_name, + disk_access_name=disk_access_name, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + 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'), + 'diskAccessName': self._serialize.url("disk_access_name", disk_access_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskAccesses/{diskAccessName}'} # type: ignore + + def list_by_resource_group( + self, + resource_group_name: str, + **kwargs + ) -> AsyncIterable["_models.DiskAccessList"]: + """Lists all the disk access resources under a resource group. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either DiskAccessList or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.compute.v2020_09_30.models.DiskAccessList] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.DiskAccessList"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-30" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_by_resource_group.metadata['url'] # type: ignore + 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'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('DiskAccessList', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskAccesses'} # type: ignore + + def list( + self, + **kwargs + ) -> AsyncIterable["_models.DiskAccessList"]: + """Lists all the disk access resources under a subscription. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either DiskAccessList or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.compute.v2020_09_30.models.DiskAccessList] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.DiskAccessList"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-30" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('DiskAccessList', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Compute/diskAccesses'} # type: ignore + + async def get_private_link_resources( + self, + resource_group_name: str, + disk_access_name: str, + **kwargs + ) -> "_models.PrivateLinkResourceListResult": + """Gets the private link resources possible under disk access resource. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param disk_access_name: The name of the disk access resource that is being created. The name + can't be changed after the disk encryption set is created. Supported characters for the name + are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. + :type disk_access_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: PrivateLinkResourceListResult, or the result of cls(response) + :rtype: ~azure.mgmt.compute.v2020_09_30.models.PrivateLinkResourceListResult + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateLinkResourceListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-30" + accept = "application/json" + + # Construct URL + url = self.get_private_link_resources.metadata['url'] # type: ignore + 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'), + 'diskAccessName': self._serialize.url("disk_access_name", disk_access_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('PrivateLinkResourceListResult', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_private_link_resources.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskAccesses/{diskAccessName}/privateLinkResources'} # type: ignore + + async def _update_a_private_endpoint_connection_initial( + self, + resource_group_name: str, + disk_access_name: str, + private_endpoint_connection_name: str, + private_endpoint_connection: "_models.PrivateEndpointConnection", + **kwargs + ) -> "_models.PrivateEndpointConnection": + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateEndpointConnection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-30" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._update_a_private_endpoint_connection_initial.metadata['url'] # type: ignore + 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'), + 'diskAccessName': self._serialize.url("disk_access_name", disk_access_name, 'str'), + 'privateEndpointConnectionName': self._serialize.url("private_endpoint_connection_name", private_endpoint_connection_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(private_endpoint_connection, 'PrivateEndpointConnection') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('PrivateEndpointConnection', pipeline_response) + + if response.status_code == 202: + deserialized = self._deserialize('PrivateEndpointConnection', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _update_a_private_endpoint_connection_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskAccesses/{diskAccessName}/privateEndpointConnections/{privateEndpointConnectionName}'} # type: ignore + + async def begin_update_a_private_endpoint_connection( + self, + resource_group_name: str, + disk_access_name: str, + private_endpoint_connection_name: str, + private_endpoint_connection: "_models.PrivateEndpointConnection", + **kwargs + ) -> AsyncLROPoller["_models.PrivateEndpointConnection"]: + """Approve or reject a private endpoint connection under disk access resource, this can't be used + to create a new private endpoint connection. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param disk_access_name: The name of the disk access resource that is being created. The name + can't be changed after the disk encryption set is created. Supported characters for the name + are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. + :type disk_access_name: str + :param private_endpoint_connection_name: The name of the private endpoint connection. + :type private_endpoint_connection_name: str + :param private_endpoint_connection: private endpoint connection object supplied in the body of + the Put private endpoint connection operation. + :type private_endpoint_connection: ~azure.mgmt.compute.v2020_09_30.models.PrivateEndpointConnection + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either PrivateEndpointConnection or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2020_09_30.models.PrivateEndpointConnection] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateEndpointConnection"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._update_a_private_endpoint_connection_initial( + resource_group_name=resource_group_name, + disk_access_name=disk_access_name, + private_endpoint_connection_name=private_endpoint_connection_name, + private_endpoint_connection=private_endpoint_connection, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('PrivateEndpointConnection', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + 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'), + 'diskAccessName': self._serialize.url("disk_access_name", disk_access_name, 'str'), + 'privateEndpointConnectionName': self._serialize.url("private_endpoint_connection_name", private_endpoint_connection_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_update_a_private_endpoint_connection.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskAccesses/{diskAccessName}/privateEndpointConnections/{privateEndpointConnectionName}'} # type: ignore + + async def get_a_private_endpoint_connection( + self, + resource_group_name: str, + disk_access_name: str, + private_endpoint_connection_name: str, + **kwargs + ) -> "_models.PrivateEndpointConnection": + """Gets information about a private endpoint connection under a disk access resource. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param disk_access_name: The name of the disk access resource that is being created. The name + can't be changed after the disk encryption set is created. Supported characters for the name + are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. + :type disk_access_name: str + :param private_endpoint_connection_name: The name of the private endpoint connection. + :type private_endpoint_connection_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: PrivateEndpointConnection, or the result of cls(response) + :rtype: ~azure.mgmt.compute.v2020_09_30.models.PrivateEndpointConnection + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateEndpointConnection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-30" + accept = "application/json" + + # Construct URL + url = self.get_a_private_endpoint_connection.metadata['url'] # type: ignore + 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'), + 'diskAccessName': self._serialize.url("disk_access_name", disk_access_name, 'str'), + 'privateEndpointConnectionName': self._serialize.url("private_endpoint_connection_name", private_endpoint_connection_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('PrivateEndpointConnection', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_a_private_endpoint_connection.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskAccesses/{diskAccessName}/privateEndpointConnections/{privateEndpointConnectionName}'} # type: ignore + + async def _delete_a_private_endpoint_connection_initial( + self, + resource_group_name: str, + disk_access_name: str, + private_endpoint_connection_name: str, + **kwargs + ) -> None: + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-30" + accept = "application/json" + + # Construct URL + url = self._delete_a_private_endpoint_connection_initial.metadata['url'] # type: ignore + 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'), + 'diskAccessName': self._serialize.url("disk_access_name", disk_access_name, 'str'), + 'privateEndpointConnectionName': self._serialize.url("private_endpoint_connection_name", private_endpoint_connection_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _delete_a_private_endpoint_connection_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskAccesses/{diskAccessName}/privateEndpointConnections/{privateEndpointConnectionName}'} # type: ignore + + async def begin_delete_a_private_endpoint_connection( + self, + resource_group_name: str, + disk_access_name: str, + private_endpoint_connection_name: str, + **kwargs + ) -> AsyncLROPoller[None]: + """Deletes a private endpoint connection under a disk access resource. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param disk_access_name: The name of the disk access resource that is being created. The name + can't be changed after the disk encryption set is created. Supported characters for the name + are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. + :type disk_access_name: str + :param private_endpoint_connection_name: The name of the private endpoint connection. + :type private_endpoint_connection_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._delete_a_private_endpoint_connection_initial( + resource_group_name=resource_group_name, + disk_access_name=disk_access_name, + private_endpoint_connection_name=private_endpoint_connection_name, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + 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'), + 'diskAccessName': self._serialize.url("disk_access_name", disk_access_name, 'str'), + 'privateEndpointConnectionName': self._serialize.url("private_endpoint_connection_name", private_endpoint_connection_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete_a_private_endpoint_connection.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskAccesses/{diskAccessName}/privateEndpointConnections/{privateEndpointConnectionName}'} # type: ignore + + def list_private_endpoint_connections( + self, + resource_group_name: str, + disk_access_name: str, + **kwargs + ) -> AsyncIterable["_models.PrivateEndpointConnectionListResult"]: + """List information about private endpoint connections under a disk access resource. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param disk_access_name: The name of the disk access resource that is being created. The name + can't be changed after the disk encryption set is created. Supported characters for the name + are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. + :type disk_access_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either PrivateEndpointConnectionListResult or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.compute.v2020_09_30.models.PrivateEndpointConnectionListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateEndpointConnectionListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-30" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_private_endpoint_connections.metadata['url'] # type: ignore + 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'), + 'diskAccessName': self._serialize.url("disk_access_name", disk_access_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('PrivateEndpointConnectionListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_private_endpoint_connections.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskAccesses/{diskAccessName}/privateEndpointConnections'} # type: ignore diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_09_30/aio/operations/_disk_encryption_sets_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_09_30/aio/operations/_disk_encryption_sets_operations.py new file mode 100644 index 000000000000..5c5614943a61 --- /dev/null +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_09_30/aio/operations/_disk_encryption_sets_operations.py @@ -0,0 +1,688 @@ +# 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 typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling + +from ... import models as _models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class DiskEncryptionSetsOperations: + """DiskEncryptionSetsOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.compute.v2020_09_30.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + async def _create_or_update_initial( + self, + resource_group_name: str, + disk_encryption_set_name: str, + disk_encryption_set: "_models.DiskEncryptionSet", + **kwargs + ) -> "_models.DiskEncryptionSet": + cls = kwargs.pop('cls', None) # type: ClsType["_models.DiskEncryptionSet"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-30" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._create_or_update_initial.metadata['url'] # type: ignore + 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'), + 'diskEncryptionSetName': self._serialize.url("disk_encryption_set_name", disk_encryption_set_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(disk_encryption_set, 'DiskEncryptionSet') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('DiskEncryptionSet', pipeline_response) + + if response.status_code == 202: + deserialized = self._deserialize('DiskEncryptionSet', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskEncryptionSets/{diskEncryptionSetName}'} # type: ignore + + async def begin_create_or_update( + self, + resource_group_name: str, + disk_encryption_set_name: str, + disk_encryption_set: "_models.DiskEncryptionSet", + **kwargs + ) -> AsyncLROPoller["_models.DiskEncryptionSet"]: + """Creates or updates a disk encryption set. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param disk_encryption_set_name: The name of the disk encryption set that is being created. The + name can't be changed after the disk encryption set is created. Supported characters for the + name are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. + :type disk_encryption_set_name: str + :param disk_encryption_set: disk encryption set object supplied in the body of the Put disk + encryption set operation. + :type disk_encryption_set: ~azure.mgmt.compute.v2020_09_30.models.DiskEncryptionSet + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either DiskEncryptionSet or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2020_09_30.models.DiskEncryptionSet] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DiskEncryptionSet"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._create_or_update_initial( + resource_group_name=resource_group_name, + disk_encryption_set_name=disk_encryption_set_name, + disk_encryption_set=disk_encryption_set, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('DiskEncryptionSet', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + 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'), + 'diskEncryptionSetName': self._serialize.url("disk_encryption_set_name", disk_encryption_set_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskEncryptionSets/{diskEncryptionSetName}'} # type: ignore + + async def _update_initial( + self, + resource_group_name: str, + disk_encryption_set_name: str, + disk_encryption_set: "_models.DiskEncryptionSetUpdate", + **kwargs + ) -> "_models.DiskEncryptionSet": + cls = kwargs.pop('cls', None) # type: ClsType["_models.DiskEncryptionSet"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-30" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._update_initial.metadata['url'] # type: ignore + 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'), + 'diskEncryptionSetName': self._serialize.url("disk_encryption_set_name", disk_encryption_set_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(disk_encryption_set, 'DiskEncryptionSetUpdate') + body_content_kwargs['content'] = body_content + request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('DiskEncryptionSet', pipeline_response) + + if response.status_code == 202: + deserialized = self._deserialize('DiskEncryptionSet', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskEncryptionSets/{diskEncryptionSetName}'} # type: ignore + + async def begin_update( + self, + resource_group_name: str, + disk_encryption_set_name: str, + disk_encryption_set: "_models.DiskEncryptionSetUpdate", + **kwargs + ) -> AsyncLROPoller["_models.DiskEncryptionSet"]: + """Updates (patches) a disk encryption set. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param disk_encryption_set_name: The name of the disk encryption set that is being created. The + name can't be changed after the disk encryption set is created. Supported characters for the + name are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. + :type disk_encryption_set_name: str + :param disk_encryption_set: disk encryption set object supplied in the body of the Patch disk + encryption set operation. + :type disk_encryption_set: ~azure.mgmt.compute.v2020_09_30.models.DiskEncryptionSetUpdate + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either DiskEncryptionSet or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2020_09_30.models.DiskEncryptionSet] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DiskEncryptionSet"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._update_initial( + resource_group_name=resource_group_name, + disk_encryption_set_name=disk_encryption_set_name, + disk_encryption_set=disk_encryption_set, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('DiskEncryptionSet', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + 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'), + 'diskEncryptionSetName': self._serialize.url("disk_encryption_set_name", disk_encryption_set_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskEncryptionSets/{diskEncryptionSetName}'} # type: ignore + + async def get( + self, + resource_group_name: str, + disk_encryption_set_name: str, + **kwargs + ) -> "_models.DiskEncryptionSet": + """Gets information about a disk encryption set. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param disk_encryption_set_name: The name of the disk encryption set that is being created. The + name can't be changed after the disk encryption set is created. Supported characters for the + name are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. + :type disk_encryption_set_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: DiskEncryptionSet, or the result of cls(response) + :rtype: ~azure.mgmt.compute.v2020_09_30.models.DiskEncryptionSet + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.DiskEncryptionSet"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-30" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + 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'), + 'diskEncryptionSetName': self._serialize.url("disk_encryption_set_name", disk_encryption_set_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('DiskEncryptionSet', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskEncryptionSets/{diskEncryptionSetName}'} # type: ignore + + async def _delete_initial( + self, + resource_group_name: str, + disk_encryption_set_name: str, + **kwargs + ) -> None: + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-30" + accept = "application/json" + + # Construct URL + url = self._delete_initial.metadata['url'] # type: ignore + 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'), + 'diskEncryptionSetName': self._serialize.url("disk_encryption_set_name", disk_encryption_set_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskEncryptionSets/{diskEncryptionSetName}'} # type: ignore + + async def begin_delete( + self, + resource_group_name: str, + disk_encryption_set_name: str, + **kwargs + ) -> AsyncLROPoller[None]: + """Deletes a disk encryption set. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param disk_encryption_set_name: The name of the disk encryption set that is being created. The + name can't be changed after the disk encryption set is created. Supported characters for the + name are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. + :type disk_encryption_set_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._delete_initial( + resource_group_name=resource_group_name, + disk_encryption_set_name=disk_encryption_set_name, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + 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'), + 'diskEncryptionSetName': self._serialize.url("disk_encryption_set_name", disk_encryption_set_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskEncryptionSets/{diskEncryptionSetName}'} # type: ignore + + def list_by_resource_group( + self, + resource_group_name: str, + **kwargs + ) -> AsyncIterable["_models.DiskEncryptionSetList"]: + """Lists all the disk encryption sets under a resource group. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either DiskEncryptionSetList or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.compute.v2020_09_30.models.DiskEncryptionSetList] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.DiskEncryptionSetList"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-30" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_by_resource_group.metadata['url'] # type: ignore + 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'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('DiskEncryptionSetList', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskEncryptionSets'} # type: ignore + + def list( + self, + **kwargs + ) -> AsyncIterable["_models.DiskEncryptionSetList"]: + """Lists all the disk encryption sets under a subscription. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either DiskEncryptionSetList or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.compute.v2020_09_30.models.DiskEncryptionSetList] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.DiskEncryptionSetList"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-30" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('DiskEncryptionSetList', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Compute/diskEncryptionSets'} # type: ignore + + def list_associated_resources( + self, + resource_group_name: str, + disk_encryption_set_name: str, + **kwargs + ) -> AsyncIterable["_models.ResourceUriList"]: + """Lists all resources that are encrypted with this disk encryption set. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param disk_encryption_set_name: The name of the disk encryption set that is being created. The + name can't be changed after the disk encryption set is created. Supported characters for the + name are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. + :type disk_encryption_set_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either ResourceUriList or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.compute.v2020_09_30.models.ResourceUriList] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ResourceUriList"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-30" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_associated_resources.metadata['url'] # type: ignore + 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'), + 'diskEncryptionSetName': self._serialize.url("disk_encryption_set_name", disk_encryption_set_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('ResourceUriList', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_associated_resources.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskEncryptionSets/{diskEncryptionSetName}/associatedResources'} # type: ignore diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_09_30/aio/operations/_disk_restore_point_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_09_30/aio/operations/_disk_restore_point_operations.py new file mode 100644 index 000000000000..21c02713bfb7 --- /dev/null +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_09_30/aio/operations/_disk_restore_point_operations.py @@ -0,0 +1,195 @@ +# 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 typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.mgmt.core.exceptions import ARMErrorFormat + +from ... import models as _models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class DiskRestorePointOperations: + """DiskRestorePointOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.compute.v2020_09_30.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + async def get( + self, + resource_group_name: str, + restore_point_collection_name: str, + vm_restore_point_name: str, + disk_restore_point_name: str, + **kwargs + ) -> "_models.DiskRestorePoint": + """Get disk restorePoint resource. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param restore_point_collection_name: The name of the restore point collection that the disk + restore point belongs. Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum + name length is 80 characters. + :type restore_point_collection_name: str + :param vm_restore_point_name: The name of the vm restore point that the disk disk restore point + belongs. Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum name length is + 80 characters. + :type vm_restore_point_name: str + :param disk_restore_point_name: The name of the disk restore point created. Supported + characters for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. + :type disk_restore_point_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: DiskRestorePoint, or the result of cls(response) + :rtype: ~azure.mgmt.compute.v2020_09_30.models.DiskRestorePoint + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.DiskRestorePoint"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-30" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + 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'), + 'restorePointCollectionName': self._serialize.url("restore_point_collection_name", restore_point_collection_name, 'str'), + 'vmRestorePointName': self._serialize.url("vm_restore_point_name", vm_restore_point_name, 'str'), + 'diskRestorePointName': self._serialize.url("disk_restore_point_name", disk_restore_point_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('DiskRestorePoint', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/restorePointCollections/{restorePointCollectionName}/restorePoints/{vmRestorePointName}/diskRestorePoints/{diskRestorePointName}'} # type: ignore + + def list_by_restore_point( + self, + resource_group_name: str, + restore_point_collection_name: str, + vm_restore_point_name: str, + **kwargs + ) -> AsyncIterable["_models.DiskRestorePointList"]: + """Lists diskRestorePoints under a vmRestorePoint. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param restore_point_collection_name: The name of the restore point collection that the disk + restore point belongs. Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum + name length is 80 characters. + :type restore_point_collection_name: str + :param vm_restore_point_name: The name of the vm restore point that the disk disk restore point + belongs. Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum name length is + 80 characters. + :type vm_restore_point_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either DiskRestorePointList or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.compute.v2020_09_30.models.DiskRestorePointList] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.DiskRestorePointList"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-30" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_by_restore_point.metadata['url'] # type: ignore + 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'), + 'restorePointCollectionName': self._serialize.url("restore_point_collection_name", restore_point_collection_name, 'str'), + 'vmRestorePointName': self._serialize.url("vm_restore_point_name", vm_restore_point_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('DiskRestorePointList', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_by_restore_point.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/restorePointCollections/{restorePointCollectionName}/restorePoints/{vmRestorePointName}/diskRestorePoints'} # type: ignore diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_09_30/aio/operations/_disks_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_09_30/aio/operations/_disks_operations.py new file mode 100644 index 000000000000..aa508304f0b5 --- /dev/null +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_09_30/aio/operations/_disks_operations.py @@ -0,0 +1,845 @@ +# 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 typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling + +from ... import models as _models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class DisksOperations: + """DisksOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.compute.v2020_09_30.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + async def _create_or_update_initial( + self, + resource_group_name: str, + disk_name: str, + disk: "_models.Disk", + **kwargs + ) -> "_models.Disk": + cls = kwargs.pop('cls', None) # type: ClsType["_models.Disk"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-30" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._create_or_update_initial.metadata['url'] # type: ignore + 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'), + 'diskName': self._serialize.url("disk_name", disk_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(disk, 'Disk') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('Disk', pipeline_response) + + if response.status_code == 202: + deserialized = self._deserialize('Disk', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/disks/{diskName}'} # type: ignore + + async def begin_create_or_update( + self, + resource_group_name: str, + disk_name: str, + disk: "_models.Disk", + **kwargs + ) -> AsyncLROPoller["_models.Disk"]: + """Creates or updates a disk. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param disk_name: The name of the managed disk that is being created. The name can't be changed + after the disk is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The + maximum name length is 80 characters. + :type disk_name: str + :param disk: Disk object supplied in the body of the Put disk operation. + :type disk: ~azure.mgmt.compute.v2020_09_30.models.Disk + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either Disk or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2020_09_30.models.Disk] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Disk"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._create_or_update_initial( + resource_group_name=resource_group_name, + disk_name=disk_name, + disk=disk, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('Disk', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + 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'), + 'diskName': self._serialize.url("disk_name", disk_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/disks/{diskName}'} # type: ignore + + async def _update_initial( + self, + resource_group_name: str, + disk_name: str, + disk: "_models.DiskUpdate", + **kwargs + ) -> "_models.Disk": + cls = kwargs.pop('cls', None) # type: ClsType["_models.Disk"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-30" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._update_initial.metadata['url'] # type: ignore + 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'), + 'diskName': self._serialize.url("disk_name", disk_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(disk, 'DiskUpdate') + body_content_kwargs['content'] = body_content + request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('Disk', pipeline_response) + + if response.status_code == 202: + deserialized = self._deserialize('Disk', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/disks/{diskName}'} # type: ignore + + async def begin_update( + self, + resource_group_name: str, + disk_name: str, + disk: "_models.DiskUpdate", + **kwargs + ) -> AsyncLROPoller["_models.Disk"]: + """Updates (patches) a disk. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param disk_name: The name of the managed disk that is being created. The name can't be changed + after the disk is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The + maximum name length is 80 characters. + :type disk_name: str + :param disk: Disk object supplied in the body of the Patch disk operation. + :type disk: ~azure.mgmt.compute.v2020_09_30.models.DiskUpdate + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either Disk or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2020_09_30.models.Disk] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Disk"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._update_initial( + resource_group_name=resource_group_name, + disk_name=disk_name, + disk=disk, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('Disk', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + 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'), + 'diskName': self._serialize.url("disk_name", disk_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/disks/{diskName}'} # type: ignore + + async def get( + self, + resource_group_name: str, + disk_name: str, + **kwargs + ) -> "_models.Disk": + """Gets information about a disk. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param disk_name: The name of the managed disk that is being created. The name can't be changed + after the disk is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The + maximum name length is 80 characters. + :type disk_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: Disk, or the result of cls(response) + :rtype: ~azure.mgmt.compute.v2020_09_30.models.Disk + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.Disk"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-30" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + 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'), + 'diskName': self._serialize.url("disk_name", disk_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('Disk', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/disks/{diskName}'} # type: ignore + + async def _delete_initial( + self, + resource_group_name: str, + disk_name: str, + **kwargs + ) -> None: + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-30" + + # Construct URL + url = self._delete_initial.metadata['url'] # type: ignore + 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'), + 'diskName': self._serialize.url("disk_name", disk_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/disks/{diskName}'} # type: ignore + + async def begin_delete( + self, + resource_group_name: str, + disk_name: str, + **kwargs + ) -> AsyncLROPoller[None]: + """Deletes a disk. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param disk_name: The name of the managed disk that is being created. The name can't be changed + after the disk is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The + maximum name length is 80 characters. + :type disk_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._delete_initial( + resource_group_name=resource_group_name, + disk_name=disk_name, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + 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'), + 'diskName': self._serialize.url("disk_name", disk_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/disks/{diskName}'} # type: ignore + + def list_by_resource_group( + self, + resource_group_name: str, + **kwargs + ) -> AsyncIterable["_models.DiskList"]: + """Lists all the disks under a resource group. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either DiskList or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.compute.v2020_09_30.models.DiskList] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.DiskList"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-30" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_by_resource_group.metadata['url'] # type: ignore + 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'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('DiskList', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/disks'} # type: ignore + + def list( + self, + **kwargs + ) -> AsyncIterable["_models.DiskList"]: + """Lists all the disks under a subscription. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either DiskList or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.compute.v2020_09_30.models.DiskList] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.DiskList"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-30" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('DiskList', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Compute/disks'} # type: ignore + + async def _grant_access_initial( + self, + resource_group_name: str, + disk_name: str, + grant_access_data: "_models.GrantAccessData", + **kwargs + ) -> Optional["_models.AccessUri"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.AccessUri"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-30" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._grant_access_initial.metadata['url'] # type: ignore + 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'), + 'diskName': self._serialize.url("disk_name", disk_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(grant_access_data, 'GrantAccessData') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('AccessUri', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _grant_access_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/disks/{diskName}/beginGetAccess'} # type: ignore + + async def begin_grant_access( + self, + resource_group_name: str, + disk_name: str, + grant_access_data: "_models.GrantAccessData", + **kwargs + ) -> AsyncLROPoller["_models.AccessUri"]: + """Grants access to a disk. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param disk_name: The name of the managed disk that is being created. The name can't be changed + after the disk is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The + maximum name length is 80 characters. + :type disk_name: str + :param grant_access_data: Access data object supplied in the body of the get disk access + operation. + :type grant_access_data: ~azure.mgmt.compute.v2020_09_30.models.GrantAccessData + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either AccessUri or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2020_09_30.models.AccessUri] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AccessUri"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._grant_access_initial( + resource_group_name=resource_group_name, + disk_name=disk_name, + grant_access_data=grant_access_data, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('AccessUri', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + 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'), + 'diskName': self._serialize.url("disk_name", disk_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_grant_access.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/disks/{diskName}/beginGetAccess'} # type: ignore + + async def _revoke_access_initial( + self, + resource_group_name: str, + disk_name: str, + **kwargs + ) -> None: + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-30" + + # Construct URL + url = self._revoke_access_initial.metadata['url'] # type: ignore + 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'), + 'diskName': self._serialize.url("disk_name", disk_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _revoke_access_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/disks/{diskName}/endGetAccess'} # type: ignore + + async def begin_revoke_access( + self, + resource_group_name: str, + disk_name: str, + **kwargs + ) -> AsyncLROPoller[None]: + """Revokes access to a disk. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param disk_name: The name of the managed disk that is being created. The name can't be changed + after the disk is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The + maximum name length is 80 characters. + :type disk_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._revoke_access_initial( + resource_group_name=resource_group_name, + disk_name=disk_name, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + 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'), + 'diskName': self._serialize.url("disk_name", disk_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_revoke_access.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/disks/{diskName}/endGetAccess'} # type: ignore diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_09_30/aio/operations/_snapshots_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_09_30/aio/operations/_snapshots_operations.py new file mode 100644 index 000000000000..f26eb247d43f --- /dev/null +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_09_30/aio/operations/_snapshots_operations.py @@ -0,0 +1,845 @@ +# 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 typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling + +from ... import models as _models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class SnapshotsOperations: + """SnapshotsOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.compute.v2020_09_30.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + async def _create_or_update_initial( + self, + resource_group_name: str, + snapshot_name: str, + snapshot: "_models.Snapshot", + **kwargs + ) -> "_models.Snapshot": + cls = kwargs.pop('cls', None) # type: ClsType["_models.Snapshot"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-30" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._create_or_update_initial.metadata['url'] # type: ignore + 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'), + 'snapshotName': self._serialize.url("snapshot_name", snapshot_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(snapshot, 'Snapshot') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('Snapshot', pipeline_response) + + if response.status_code == 202: + deserialized = self._deserialize('Snapshot', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/snapshots/{snapshotName}'} # type: ignore + + async def begin_create_or_update( + self, + resource_group_name: str, + snapshot_name: str, + snapshot: "_models.Snapshot", + **kwargs + ) -> AsyncLROPoller["_models.Snapshot"]: + """Creates or updates a snapshot. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param snapshot_name: The name of the snapshot that is being created. The name can't be changed + after the snapshot is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The + max name length is 80 characters. + :type snapshot_name: str + :param snapshot: Snapshot object supplied in the body of the Put disk operation. + :type snapshot: ~azure.mgmt.compute.v2020_09_30.models.Snapshot + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either Snapshot or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2020_09_30.models.Snapshot] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Snapshot"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._create_or_update_initial( + resource_group_name=resource_group_name, + snapshot_name=snapshot_name, + snapshot=snapshot, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('Snapshot', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + 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'), + 'snapshotName': self._serialize.url("snapshot_name", snapshot_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/snapshots/{snapshotName}'} # type: ignore + + async def _update_initial( + self, + resource_group_name: str, + snapshot_name: str, + snapshot: "_models.SnapshotUpdate", + **kwargs + ) -> "_models.Snapshot": + cls = kwargs.pop('cls', None) # type: ClsType["_models.Snapshot"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-30" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._update_initial.metadata['url'] # type: ignore + 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'), + 'snapshotName': self._serialize.url("snapshot_name", snapshot_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(snapshot, 'SnapshotUpdate') + body_content_kwargs['content'] = body_content + request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('Snapshot', pipeline_response) + + if response.status_code == 202: + deserialized = self._deserialize('Snapshot', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/snapshots/{snapshotName}'} # type: ignore + + async def begin_update( + self, + resource_group_name: str, + snapshot_name: str, + snapshot: "_models.SnapshotUpdate", + **kwargs + ) -> AsyncLROPoller["_models.Snapshot"]: + """Updates (patches) a snapshot. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param snapshot_name: The name of the snapshot that is being created. The name can't be changed + after the snapshot is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The + max name length is 80 characters. + :type snapshot_name: str + :param snapshot: Snapshot object supplied in the body of the Patch snapshot operation. + :type snapshot: ~azure.mgmt.compute.v2020_09_30.models.SnapshotUpdate + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either Snapshot or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2020_09_30.models.Snapshot] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Snapshot"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._update_initial( + resource_group_name=resource_group_name, + snapshot_name=snapshot_name, + snapshot=snapshot, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('Snapshot', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + 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'), + 'snapshotName': self._serialize.url("snapshot_name", snapshot_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/snapshots/{snapshotName}'} # type: ignore + + async def get( + self, + resource_group_name: str, + snapshot_name: str, + **kwargs + ) -> "_models.Snapshot": + """Gets information about a snapshot. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param snapshot_name: The name of the snapshot that is being created. The name can't be changed + after the snapshot is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The + max name length is 80 characters. + :type snapshot_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: Snapshot, or the result of cls(response) + :rtype: ~azure.mgmt.compute.v2020_09_30.models.Snapshot + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.Snapshot"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-30" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + 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'), + 'snapshotName': self._serialize.url("snapshot_name", snapshot_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('Snapshot', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/snapshots/{snapshotName}'} # type: ignore + + async def _delete_initial( + self, + resource_group_name: str, + snapshot_name: str, + **kwargs + ) -> None: + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-30" + + # Construct URL + url = self._delete_initial.metadata['url'] # type: ignore + 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'), + 'snapshotName': self._serialize.url("snapshot_name", snapshot_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/snapshots/{snapshotName}'} # type: ignore + + async def begin_delete( + self, + resource_group_name: str, + snapshot_name: str, + **kwargs + ) -> AsyncLROPoller[None]: + """Deletes a snapshot. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param snapshot_name: The name of the snapshot that is being created. The name can't be changed + after the snapshot is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The + max name length is 80 characters. + :type snapshot_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._delete_initial( + resource_group_name=resource_group_name, + snapshot_name=snapshot_name, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + 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'), + 'snapshotName': self._serialize.url("snapshot_name", snapshot_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/snapshots/{snapshotName}'} # type: ignore + + def list_by_resource_group( + self, + resource_group_name: str, + **kwargs + ) -> AsyncIterable["_models.SnapshotList"]: + """Lists snapshots under a resource group. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either SnapshotList or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.compute.v2020_09_30.models.SnapshotList] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SnapshotList"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-30" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_by_resource_group.metadata['url'] # type: ignore + 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'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('SnapshotList', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/snapshots'} # type: ignore + + def list( + self, + **kwargs + ) -> AsyncIterable["_models.SnapshotList"]: + """Lists snapshots under a subscription. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either SnapshotList or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.compute.v2020_09_30.models.SnapshotList] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SnapshotList"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-30" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('SnapshotList', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Compute/snapshots'} # type: ignore + + async def _grant_access_initial( + self, + resource_group_name: str, + snapshot_name: str, + grant_access_data: "_models.GrantAccessData", + **kwargs + ) -> Optional["_models.AccessUri"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.AccessUri"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-30" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._grant_access_initial.metadata['url'] # type: ignore + 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'), + 'snapshotName': self._serialize.url("snapshot_name", snapshot_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(grant_access_data, 'GrantAccessData') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('AccessUri', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _grant_access_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/snapshots/{snapshotName}/beginGetAccess'} # type: ignore + + async def begin_grant_access( + self, + resource_group_name: str, + snapshot_name: str, + grant_access_data: "_models.GrantAccessData", + **kwargs + ) -> AsyncLROPoller["_models.AccessUri"]: + """Grants access to a snapshot. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param snapshot_name: The name of the snapshot that is being created. The name can't be changed + after the snapshot is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The + max name length is 80 characters. + :type snapshot_name: str + :param grant_access_data: Access data object supplied in the body of the get snapshot access + operation. + :type grant_access_data: ~azure.mgmt.compute.v2020_09_30.models.GrantAccessData + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either AccessUri or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.compute.v2020_09_30.models.AccessUri] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AccessUri"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._grant_access_initial( + resource_group_name=resource_group_name, + snapshot_name=snapshot_name, + grant_access_data=grant_access_data, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('AccessUri', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + 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'), + 'snapshotName': self._serialize.url("snapshot_name", snapshot_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_grant_access.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/snapshots/{snapshotName}/beginGetAccess'} # type: ignore + + async def _revoke_access_initial( + self, + resource_group_name: str, + snapshot_name: str, + **kwargs + ) -> None: + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-30" + + # Construct URL + url = self._revoke_access_initial.metadata['url'] # type: ignore + 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'), + 'snapshotName': self._serialize.url("snapshot_name", snapshot_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _revoke_access_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/snapshots/{snapshotName}/endGetAccess'} # type: ignore + + async def begin_revoke_access( + self, + resource_group_name: str, + snapshot_name: str, + **kwargs + ) -> AsyncLROPoller[None]: + """Revokes access to a snapshot. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param snapshot_name: The name of the snapshot that is being created. The name can't be changed + after the snapshot is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The + max name length is 80 characters. + :type snapshot_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._revoke_access_initial( + resource_group_name=resource_group_name, + snapshot_name=snapshot_name, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + 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'), + 'snapshotName': self._serialize.url("snapshot_name", snapshot_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_revoke_access.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/snapshots/{snapshotName}/endGetAccess'} # type: ignore diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_09_30/models/__init__.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_09_30/models/__init__.py index a4ea97750b5b..e7d7c4a1c3f1 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_09_30/models/__init__.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_09_30/models/__init__.py @@ -7,12 +7,31 @@ # -------------------------------------------------------------------------- try: + from ._models_py3 import AccessUri from ._models_py3 import ApiError from ._models_py3 import ApiErrorBase + from ._models_py3 import CreationData from ._models_py3 import DataDiskImageEncryption from ._models_py3 import Disallowed + from ._models_py3 import Disk + from ._models_py3 import DiskAccess + from ._models_py3 import DiskAccessList + from ._models_py3 import DiskAccessUpdate + from ._models_py3 import DiskEncryptionSet + from ._models_py3 import DiskEncryptionSetList + from ._models_py3 import DiskEncryptionSetUpdate from ._models_py3 import DiskImageEncryption + from ._models_py3 import DiskList + from ._models_py3 import DiskRestorePoint + from ._models_py3 import DiskRestorePointList + from ._models_py3 import DiskSku + from ._models_py3 import DiskUpdate + from ._models_py3 import Encryption from ._models_py3 import EncryptionImages + from ._models_py3 import EncryptionSetIdentity + from ._models_py3 import EncryptionSettingsCollection + from ._models_py3 import EncryptionSettingsElement + from ._models_py3 import ExtendedLocation from ._models_py3 import Gallery from ._models_py3 import GalleryApplication from ._models_py3 import GalleryApplicationList @@ -40,17 +59,32 @@ from ._models_py3 import GalleryList from ._models_py3 import GalleryOSDiskImage from ._models_py3 import GalleryUpdate + from ._models_py3 import GrantAccessData + from ._models_py3 import ImageDiskReference from ._models_py3 import ImagePurchasePlan from ._models_py3 import InnerError + from ._models_py3 import KeyForDiskEncryptionSet + from ._models_py3 import KeyVaultAndKeyReference + from ._models_py3 import KeyVaultAndSecretReference from ._models_py3 import ManagedArtifact from ._models_py3 import OSDiskImageEncryption from ._models_py3 import PirResource from ._models_py3 import PirSharedGalleryResource + from ._models_py3 import PrivateEndpoint + from ._models_py3 import PrivateEndpointConnection + from ._models_py3 import PrivateEndpointConnectionListResult + from ._models_py3 import PrivateLinkResource + from ._models_py3 import PrivateLinkResourceListResult + from ._models_py3 import PrivateLinkServiceConnectionState + from ._models_py3 import ProxyOnlyResource + from ._models_py3 import PurchasePlan from ._models_py3 import RecommendedMachineConfiguration from ._models_py3 import RegionalReplicationStatus from ._models_py3 import ReplicationStatus from ._models_py3 import Resource from ._models_py3 import ResourceRange + from ._models_py3 import ResourceUriList + from ._models_py3 import ShareInfoElement from ._models_py3 import SharedGallery from ._models_py3 import SharedGalleryImage from ._models_py3 import SharedGalleryImageList @@ -60,17 +94,41 @@ from ._models_py3 import SharingProfile from ._models_py3 import SharingProfileGroup from ._models_py3 import SharingUpdate + from ._models_py3 import Snapshot + from ._models_py3 import SnapshotList + from ._models_py3 import SnapshotSku + from ._models_py3 import SnapshotUpdate + from ._models_py3 import SourceVault from ._models_py3 import TargetRegion from ._models_py3 import UpdateResourceDefinition from ._models_py3 import UserArtifactManage from ._models_py3 import UserArtifactSource except (SyntaxError, ImportError): + from ._models import AccessUri # type: ignore from ._models import ApiError # type: ignore from ._models import ApiErrorBase # type: ignore + from ._models import CreationData # type: ignore from ._models import DataDiskImageEncryption # type: ignore from ._models import Disallowed # type: ignore + from ._models import Disk # type: ignore + from ._models import DiskAccess # type: ignore + from ._models import DiskAccessList # type: ignore + from ._models import DiskAccessUpdate # type: ignore + from ._models import DiskEncryptionSet # type: ignore + from ._models import DiskEncryptionSetList # type: ignore + from ._models import DiskEncryptionSetUpdate # type: ignore from ._models import DiskImageEncryption # type: ignore + from ._models import DiskList # type: ignore + from ._models import DiskRestorePoint # type: ignore + from ._models import DiskRestorePointList # type: ignore + from ._models import DiskSku # type: ignore + from ._models import DiskUpdate # type: ignore + from ._models import Encryption # type: ignore from ._models import EncryptionImages # type: ignore + from ._models import EncryptionSetIdentity # type: ignore + from ._models import EncryptionSettingsCollection # type: ignore + from ._models import EncryptionSettingsElement # type: ignore + from ._models import ExtendedLocation # type: ignore from ._models import Gallery # type: ignore from ._models import GalleryApplication # type: ignore from ._models import GalleryApplicationList # type: ignore @@ -98,17 +156,32 @@ from ._models import GalleryList # type: ignore from ._models import GalleryOSDiskImage # type: ignore from ._models import GalleryUpdate # type: ignore + from ._models import GrantAccessData # type: ignore + from ._models import ImageDiskReference # type: ignore from ._models import ImagePurchasePlan # type: ignore from ._models import InnerError # type: ignore + from ._models import KeyForDiskEncryptionSet # type: ignore + from ._models import KeyVaultAndKeyReference # type: ignore + from ._models import KeyVaultAndSecretReference # type: ignore from ._models import ManagedArtifact # type: ignore from ._models import OSDiskImageEncryption # type: ignore from ._models import PirResource # type: ignore from ._models import PirSharedGalleryResource # type: ignore + from ._models import PrivateEndpoint # type: ignore + from ._models import PrivateEndpointConnection # type: ignore + from ._models import PrivateEndpointConnectionListResult # type: ignore + from ._models import PrivateLinkResource # type: ignore + from ._models import PrivateLinkResourceListResult # type: ignore + from ._models import PrivateLinkServiceConnectionState # type: ignore + from ._models import ProxyOnlyResource # type: ignore + from ._models import PurchasePlan # type: ignore from ._models import RecommendedMachineConfiguration # type: ignore from ._models import RegionalReplicationStatus # type: ignore from ._models import ReplicationStatus # type: ignore from ._models import Resource # type: ignore from ._models import ResourceRange # type: ignore + from ._models import ResourceUriList # type: ignore + from ._models import ShareInfoElement # type: ignore from ._models import SharedGallery # type: ignore from ._models import SharedGalleryImage # type: ignore from ._models import SharedGalleryImageList # type: ignore @@ -118,13 +191,26 @@ from ._models import SharingProfile # type: ignore from ._models import SharingProfileGroup # type: ignore from ._models import SharingUpdate # type: ignore + from ._models import Snapshot # type: ignore + from ._models import SnapshotList # type: ignore + from ._models import SnapshotSku # type: ignore + from ._models import SnapshotUpdate # type: ignore + from ._models import SourceVault # type: ignore from ._models import TargetRegion # type: ignore from ._models import UpdateResourceDefinition # type: ignore from ._models import UserArtifactManage # type: ignore from ._models import UserArtifactSource # type: ignore from ._compute_management_client_enums import ( + AccessLevel, AggregatedReplicationState, + DiskCreateOption, + DiskEncryptionSetIdentityType, + DiskEncryptionSetType, + DiskState, + DiskStorageAccountTypes, + EncryptionType, + ExtendedLocationTypes, GalleryApplicationVersionPropertiesProvisioningState, GalleryImagePropertiesProvisioningState, GalleryImageVersionPropertiesProvisioningState, @@ -132,24 +218,47 @@ GallerySharingPermissionTypes, HostCaching, HyperVGeneration, + NetworkAccessPolicy, OperatingSystemStateTypes, OperatingSystemTypes, + PrivateEndpointConnectionProvisioningState, + PrivateEndpointServiceConnectionStatus, ReplicationState, ReplicationStatusTypes, SelectPermissions, SharedToValues, SharingProfileGroupTypes, SharingUpdateOperationTypes, + SnapshotStorageAccountTypes, StorageAccountType, ) __all__ = [ + 'AccessUri', 'ApiError', 'ApiErrorBase', + 'CreationData', 'DataDiskImageEncryption', 'Disallowed', + 'Disk', + 'DiskAccess', + 'DiskAccessList', + 'DiskAccessUpdate', + 'DiskEncryptionSet', + 'DiskEncryptionSetList', + 'DiskEncryptionSetUpdate', 'DiskImageEncryption', + 'DiskList', + 'DiskRestorePoint', + 'DiskRestorePointList', + 'DiskSku', + 'DiskUpdate', + 'Encryption', 'EncryptionImages', + 'EncryptionSetIdentity', + 'EncryptionSettingsCollection', + 'EncryptionSettingsElement', + 'ExtendedLocation', 'Gallery', 'GalleryApplication', 'GalleryApplicationList', @@ -177,17 +286,32 @@ 'GalleryList', 'GalleryOSDiskImage', 'GalleryUpdate', + 'GrantAccessData', + 'ImageDiskReference', 'ImagePurchasePlan', 'InnerError', + 'KeyForDiskEncryptionSet', + 'KeyVaultAndKeyReference', + 'KeyVaultAndSecretReference', 'ManagedArtifact', 'OSDiskImageEncryption', 'PirResource', 'PirSharedGalleryResource', + 'PrivateEndpoint', + 'PrivateEndpointConnection', + 'PrivateEndpointConnectionListResult', + 'PrivateLinkResource', + 'PrivateLinkResourceListResult', + 'PrivateLinkServiceConnectionState', + 'ProxyOnlyResource', + 'PurchasePlan', 'RecommendedMachineConfiguration', 'RegionalReplicationStatus', 'ReplicationStatus', 'Resource', 'ResourceRange', + 'ResourceUriList', + 'ShareInfoElement', 'SharedGallery', 'SharedGalleryImage', 'SharedGalleryImageList', @@ -197,11 +321,24 @@ 'SharingProfile', 'SharingProfileGroup', 'SharingUpdate', + 'Snapshot', + 'SnapshotList', + 'SnapshotSku', + 'SnapshotUpdate', + 'SourceVault', 'TargetRegion', 'UpdateResourceDefinition', 'UserArtifactManage', 'UserArtifactSource', + 'AccessLevel', 'AggregatedReplicationState', + 'DiskCreateOption', + 'DiskEncryptionSetIdentityType', + 'DiskEncryptionSetType', + 'DiskState', + 'DiskStorageAccountTypes', + 'EncryptionType', + 'ExtendedLocationTypes', 'GalleryApplicationVersionPropertiesProvisioningState', 'GalleryImagePropertiesProvisioningState', 'GalleryImageVersionPropertiesProvisioningState', @@ -209,13 +346,17 @@ 'GallerySharingPermissionTypes', 'HostCaching', 'HyperVGeneration', + 'NetworkAccessPolicy', 'OperatingSystemStateTypes', 'OperatingSystemTypes', + 'PrivateEndpointConnectionProvisioningState', + 'PrivateEndpointServiceConnectionStatus', 'ReplicationState', 'ReplicationStatusTypes', 'SelectPermissions', 'SharedToValues', 'SharingProfileGroupTypes', 'SharingUpdateOperationTypes', + 'SnapshotStorageAccountTypes', 'StorageAccountType', ] diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_09_30/models/_compute_management_client_enums.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_09_30/models/_compute_management_client_enums.py index 03c24ad074a1..e60720bd191f 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_09_30/models/_compute_management_client_enums.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_09_30/models/_compute_management_client_enums.py @@ -26,6 +26,12 @@ def __getattr__(cls, name): raise AttributeError(name) +class AccessLevel(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + + NONE = "None" + READ = "Read" + WRITE = "Write" + class AggregatedReplicationState(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """This is the aggregated replication status based on all the regional replication status flags. """ @@ -35,6 +41,69 @@ class AggregatedReplicationState(with_metaclass(_CaseInsensitiveEnumMeta, str, E COMPLETED = "Completed" FAILED = "Failed" +class DiskCreateOption(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """This enumerates the possible sources of a disk's creation. + """ + + EMPTY = "Empty" #: Create an empty data disk of a size given by diskSizeGB. + ATTACH = "Attach" #: Disk will be attached to a VM. + FROM_IMAGE = "FromImage" #: Create a new disk from a platform image specified by the given imageReference or galleryImageReference. + IMPORT_ENUM = "Import" #: Create a disk by importing from a blob specified by a sourceUri in a storage account specified by storageAccountId. + COPY = "Copy" #: Create a new disk or snapshot by copying from a disk or snapshot specified by the given sourceResourceId. + RESTORE = "Restore" #: Create a new disk by copying from a backup recovery point. + UPLOAD = "Upload" #: Create a new disk by obtaining a write token and using it to directly upload the contents of the disk. + +class DiskEncryptionSetIdentityType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """The type of Managed Identity used by the DiskEncryptionSet. Only SystemAssigned is supported + for new creations. Disk Encryption Sets can be updated with Identity type None during migration + of subscription to a new Azure Active Directory tenant; it will cause the encrypted resources + to lose access to the keys. + """ + + SYSTEM_ASSIGNED = "SystemAssigned" + NONE = "None" + +class DiskEncryptionSetType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """The type of key used to encrypt the data of the disk. + """ + + ENCRYPTION_AT_REST_WITH_CUSTOMER_KEY = "EncryptionAtRestWithCustomerKey" #: Resource using diskEncryptionSet would be encrypted at rest with Customer managed key that can be changed and revoked by a customer. + ENCRYPTION_AT_REST_WITH_PLATFORM_AND_CUSTOMER_KEYS = "EncryptionAtRestWithPlatformAndCustomerKeys" #: Resource using diskEncryptionSet would be encrypted at rest with two layers of encryption. One of the keys is Customer managed and the other key is Platform managed. + +class DiskState(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """This enumerates the possible state of the disk. + """ + + UNATTACHED = "Unattached" #: The disk is not being used and can be attached to a VM. + ATTACHED = "Attached" #: The disk is currently mounted to a running VM. + RESERVED = "Reserved" #: The disk is mounted to a stopped-deallocated VM. + ACTIVE_SAS = "ActiveSAS" #: The disk currently has an Active SAS Uri associated with it. + READY_TO_UPLOAD = "ReadyToUpload" #: A disk is ready to be created by upload by requesting a write token. + ACTIVE_UPLOAD = "ActiveUpload" #: A disk is created for upload and a write token has been issued for uploading to it. + +class DiskStorageAccountTypes(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """The sku name. + """ + + STANDARD_LRS = "Standard_LRS" #: Standard HDD locally redundant storage. Best for backup, non-critical, and infrequent access. + PREMIUM_LRS = "Premium_LRS" #: Premium SSD locally redundant storage. Best for production and performance sensitive workloads. + STANDARD_SSD_LRS = "StandardSSD_LRS" #: Standard SSD locally redundant storage. Best for web servers, lightly used enterprise applications and dev/test. + ULTRA_SSD_LRS = "UltraSSD_LRS" #: Ultra SSD locally redundant storage. Best for IO-intensive workloads such as SAP HANA, top tier databases (for example, SQL, Oracle), and other transaction-heavy workloads. + +class EncryptionType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """The type of key used to encrypt the data of the disk. + """ + + ENCRYPTION_AT_REST_WITH_PLATFORM_KEY = "EncryptionAtRestWithPlatformKey" #: Disk is encrypted at rest with Platform managed key. It is the default encryption type. This is not a valid encryption type for disk encryption sets. + ENCRYPTION_AT_REST_WITH_CUSTOMER_KEY = "EncryptionAtRestWithCustomerKey" #: Disk is encrypted at rest with Customer managed key that can be changed and revoked by a customer. + ENCRYPTION_AT_REST_WITH_PLATFORM_AND_CUSTOMER_KEYS = "EncryptionAtRestWithPlatformAndCustomerKeys" #: Disk is encrypted at rest with 2 layers of encryption. One of the keys is Customer managed and the other key is Platform managed. + +class ExtendedLocationTypes(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """The type of extendedLocation. + """ + + EDGE_ZONE = "EdgeZone" + class GalleryApplicationVersionPropertiesProvisioningState(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """The provisioning state, which only appears in the response. """ @@ -102,6 +171,14 @@ class HyperVGeneration(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): V1 = "V1" V2 = "V2" +class NetworkAccessPolicy(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Policy for accessing the disk via network. + """ + + ALLOW_ALL = "AllowAll" #: The disk can be exported or uploaded to from any network. + ALLOW_PRIVATE = "AllowPrivate" #: The disk can be exported or uploaded to using a DiskAccess resource's private endpoints. + DENY_ALL = "DenyAll" #: The disk cannot be exported. + class OperatingSystemStateTypes(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """This property allows the user to specify whether the virtual machines created under this image are 'Generalized' or 'Specialized'. @@ -111,14 +188,29 @@ class OperatingSystemStateTypes(with_metaclass(_CaseInsensitiveEnumMeta, str, En SPECIALIZED = "Specialized" class OperatingSystemTypes(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): - """This property allows you to specify the supported type of the OS that application is built for. - :code:`
`:code:`
` Possible values are: :code:`
`:code:`
` **Windows** - :code:`
`:code:`
` **Linux** + """The Operating System type. """ WINDOWS = "Windows" LINUX = "Linux" +class PrivateEndpointConnectionProvisioningState(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """The current provisioning state. + """ + + SUCCEEDED = "Succeeded" + CREATING = "Creating" + DELETING = "Deleting" + FAILED = "Failed" + +class PrivateEndpointServiceConnectionStatus(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """The private endpoint connection status. + """ + + PENDING = "Pending" + APPROVED = "Approved" + REJECTED = "Rejected" + class ReplicationState(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """This is the regional replication state. """ @@ -159,6 +251,14 @@ class SharingUpdateOperationTypes(with_metaclass(_CaseInsensitiveEnumMeta, str, REMOVE = "Remove" RESET = "Reset" +class SnapshotStorageAccountTypes(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """The sku name. + """ + + STANDARD_LRS = "Standard_LRS" #: Standard HDD locally redundant storage. + PREMIUM_LRS = "Premium_LRS" #: Premium SSD locally redundant storage. + STANDARD_ZRS = "Standard_ZRS" #: Standard zone redundant storage. + class StorageAccountType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """Specifies the storage account type to be used to store the image. This property is not updatable. diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_09_30/models/_models.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_09_30/models/_models.py index b54f40aa446b..667bbc7c8f1e 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_09_30/models/_models.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_09_30/models/_models.py @@ -9,6 +9,31 @@ import msrest.serialization +class AccessUri(msrest.serialization.Model): + """A disk access SAS uri. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar access_sas: A SAS uri for accessing a disk. + :vartype access_sas: str + """ + + _validation = { + 'access_sas': {'readonly': True}, + } + + _attribute_map = { + 'access_sas': {'key': 'accessSAS', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(AccessUri, self).__init__(**kwargs) + self.access_sas = None + + class ApiError(msrest.serialization.Model): """Api error. @@ -71,6 +96,76 @@ def __init__( self.message = kwargs.get('message', None) +class CreationData(msrest.serialization.Model): + """Data used when creating a disk. + + 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. + + :param create_option: Required. This enumerates the possible sources of a disk's creation. + Possible values include: "Empty", "Attach", "FromImage", "Import", "Copy", "Restore", "Upload". + :type create_option: str or ~azure.mgmt.compute.v2020_09_30.models.DiskCreateOption + :param storage_account_id: Required if createOption is Import. The Azure Resource Manager + identifier of the storage account containing the blob to import as a disk. + :type storage_account_id: str + :param image_reference: Disk source information. + :type image_reference: ~azure.mgmt.compute.v2020_09_30.models.ImageDiskReference + :param gallery_image_reference: Required if creating from a Gallery Image. The id of the + ImageDiskReference will be the ARM id of the shared galley image version from which to create a + disk. + :type gallery_image_reference: ~azure.mgmt.compute.v2020_09_30.models.ImageDiskReference + :param source_uri: If createOption is Import, this is the URI of a blob to be imported into a + managed disk. + :type source_uri: str + :param source_resource_id: If createOption is Copy, this is the ARM id of the source snapshot + or disk. + :type source_resource_id: str + :ivar source_unique_id: If this field is set, this is the unique id identifying the source of + this resource. + :vartype source_unique_id: str + :param upload_size_bytes: If createOption is Upload, this is the size of the contents of the + upload including the VHD footer. This value should be between 20972032 (20 MiB + 512 bytes for + the VHD footer) and 35183298347520 bytes (32 TiB + 512 bytes for the VHD footer). + :type upload_size_bytes: long + :param logical_sector_size: Logical sector size in bytes for Ultra disks. Supported values are + 512 ad 4096. 4096 is the default. + :type logical_sector_size: int + """ + + _validation = { + 'create_option': {'required': True}, + 'source_unique_id': {'readonly': True}, + } + + _attribute_map = { + 'create_option': {'key': 'createOption', 'type': 'str'}, + 'storage_account_id': {'key': 'storageAccountId', 'type': 'str'}, + 'image_reference': {'key': 'imageReference', 'type': 'ImageDiskReference'}, + 'gallery_image_reference': {'key': 'galleryImageReference', 'type': 'ImageDiskReference'}, + 'source_uri': {'key': 'sourceUri', 'type': 'str'}, + 'source_resource_id': {'key': 'sourceResourceId', 'type': 'str'}, + 'source_unique_id': {'key': 'sourceUniqueId', 'type': 'str'}, + 'upload_size_bytes': {'key': 'uploadSizeBytes', 'type': 'long'}, + 'logical_sector_size': {'key': 'logicalSectorSize', 'type': 'int'}, + } + + def __init__( + self, + **kwargs + ): + super(CreationData, self).__init__(**kwargs) + self.create_option = kwargs['create_option'] + self.storage_account_id = kwargs.get('storage_account_id', None) + self.image_reference = kwargs.get('image_reference', None) + self.gallery_image_reference = kwargs.get('gallery_image_reference', None) + self.source_uri = kwargs.get('source_uri', None) + self.source_resource_id = kwargs.get('source_resource_id', None) + self.source_unique_id = None + self.upload_size_bytes = kwargs.get('upload_size_bytes', None) + self.logical_sector_size = kwargs.get('logical_sector_size', None) + + class DiskImageEncryption(msrest.serialization.Model): """This is the disk image encryption base class. @@ -141,29 +236,6 @@ def __init__( self.disk_types = kwargs.get('disk_types', None) -class EncryptionImages(msrest.serialization.Model): - """Optional. Allows users to provide customer managed keys for encrypting the OS and data disks in the gallery artifact. - - :param os_disk_image: This is the disk image encryption base class. - :type os_disk_image: ~azure.mgmt.compute.v2020_09_30.models.DiskImageEncryption - :param data_disk_images: A list of encryption specifications for data disk images. - :type data_disk_images: list[~azure.mgmt.compute.v2020_09_30.models.DataDiskImageEncryption] - """ - - _attribute_map = { - 'os_disk_image': {'key': 'osDiskImage', 'type': 'DiskImageEncryption'}, - 'data_disk_images': {'key': 'dataDiskImages', 'type': '[DataDiskImageEncryption]'}, - } - - def __init__( - self, - **kwargs - ): - super(EncryptionImages, self).__init__(**kwargs) - self.os_disk_image = kwargs.get('os_disk_image', None) - self.data_disk_images = kwargs.get('data_disk_images', None) - - class Resource(msrest.serialization.Model): """The Resource model definition. @@ -210,8 +282,8 @@ def __init__( self.tags = kwargs.get('tags', None) -class Gallery(Resource): - """Specifies information about the Shared Image Gallery that you want to create or update. +class Disk(Resource): + """Disk resource. Variables are only populated by the server, and will be ignored when sending a request. @@ -227,17 +299,87 @@ class Gallery(Resource): :type location: str :param tags: A set of tags. Resource tags. :type tags: dict[str, str] - :param description: The description of this Shared Image Gallery resource. This property is - updatable. - :type description: str - :param identifier: Describes the gallery unique name. - :type identifier: ~azure.mgmt.compute.v2020_09_30.models.GalleryIdentifier - :ivar provisioning_state: The provisioning state, which only appears in the response. Possible - values include: "Creating", "Updating", "Failed", "Succeeded", "Deleting", "Migrating". - :vartype provisioning_state: str or - ~azure.mgmt.compute.v2020_09_30.models.GalleryPropertiesProvisioningState - :param sharing_profile: Profile for gallery sharing to subscription or tenant. - :type sharing_profile: ~azure.mgmt.compute.v2020_09_30.models.SharingProfile + :ivar managed_by: A relative URI containing the ID of the VM that has the disk attached. + :vartype managed_by: str + :ivar managed_by_extended: List of relative URIs containing the IDs of the VMs that have the + disk attached. maxShares should be set to a value greater than one for disks to allow attaching + them to multiple VMs. + :vartype managed_by_extended: list[str] + :param sku: The disks sku name. Can be Standard_LRS, Premium_LRS, StandardSSD_LRS, or + UltraSSD_LRS. + :type sku: ~azure.mgmt.compute.v2020_09_30.models.DiskSku + :param zones: The Logical zone list for Disk. + :type zones: list[str] + :param extended_location: The extended location where the disk will be created. Extended + location cannot be changed. + :type extended_location: ~azure.mgmt.compute.v2020_09_30.models.ExtendedLocation + :ivar time_created: The time when the disk was created. + :vartype time_created: ~datetime.datetime + :param os_type: The Operating System type. Possible values include: "Windows", "Linux". + :type os_type: str or ~azure.mgmt.compute.v2020_09_30.models.OperatingSystemTypes + :param hyper_v_generation: The hypervisor generation of the Virtual Machine. Applicable to OS + disks only. Possible values include: "V1", "V2". + :type hyper_v_generation: str or ~azure.mgmt.compute.v2020_09_30.models.HyperVGeneration + :param purchase_plan: Purchase plan information for the the image from which the OS disk was + created. E.g. - {name: 2019-Datacenter, publisher: MicrosoftWindowsServer, product: + WindowsServer}. + :type purchase_plan: ~azure.mgmt.compute.v2020_09_30.models.PurchasePlan + :param creation_data: Disk source information. CreationData information cannot be changed after + the disk has been created. + :type creation_data: ~azure.mgmt.compute.v2020_09_30.models.CreationData + :param disk_size_gb: If creationData.createOption is Empty, this field is mandatory and it + indicates the size of the disk to create. If this field is present for updates or creation with + other options, it indicates a resize. Resizes are only allowed if the disk is not attached to a + running VM, and can only increase the disk's size. + :type disk_size_gb: int + :ivar disk_size_bytes: The size of the disk in bytes. This field is read only. + :vartype disk_size_bytes: long + :ivar unique_id: Unique Guid identifying the resource. + :vartype unique_id: str + :param encryption_settings_collection: Encryption settings collection used for Azure Disk + Encryption, can contain multiple encryption settings per disk or snapshot. + :type encryption_settings_collection: + ~azure.mgmt.compute.v2020_09_30.models.EncryptionSettingsCollection + :ivar provisioning_state: The disk provisioning state. + :vartype provisioning_state: str + :param disk_iops_read_write: The number of IOPS allowed for this disk; only settable for + UltraSSD disks. One operation can transfer between 4k and 256k bytes. + :type disk_iops_read_write: long + :param disk_m_bps_read_write: The bandwidth allowed for this disk; only settable for UltraSSD + disks. MBps means millions of bytes per second - MB here uses the ISO notation, of powers of + 10. + :type disk_m_bps_read_write: long + :param disk_iops_read_only: The total number of IOPS that will be allowed across all VMs + mounting the shared disk as ReadOnly. One operation can transfer between 4k and 256k bytes. + :type disk_iops_read_only: long + :param disk_m_bps_read_only: The total throughput (MBps) that will be allowed across all VMs + mounting the shared disk as ReadOnly. MBps means millions of bytes per second - MB here uses + the ISO notation, of powers of 10. + :type disk_m_bps_read_only: long + :ivar disk_state: The state of the disk. Possible values include: "Unattached", "Attached", + "Reserved", "ActiveSAS", "ReadyToUpload", "ActiveUpload". + :vartype disk_state: str or ~azure.mgmt.compute.v2020_09_30.models.DiskState + :param encryption: Encryption property can be used to encrypt data at rest with customer + managed keys or platform managed keys. + :type encryption: ~azure.mgmt.compute.v2020_09_30.models.Encryption + :param max_shares: The maximum number of VMs that can attach to the disk at the same time. + Value greater than one indicates a disk that can be mounted on multiple VMs at the same time. + :type max_shares: int + :ivar share_info: Details of the list of all VMs that have the disk attached. maxShares should + be set to a value greater than one for disks to allow attaching them to multiple VMs. + :vartype share_info: list[~azure.mgmt.compute.v2020_09_30.models.ShareInfoElement] + :param network_access_policy: Policy for accessing the disk via network. Possible values + include: "AllowAll", "AllowPrivate", "DenyAll". + :type network_access_policy: str or ~azure.mgmt.compute.v2020_09_30.models.NetworkAccessPolicy + :param disk_access_id: ARM id of the DiskAccess resource for using private endpoints on disks. + :type disk_access_id: str + :param tier: Performance tier of the disk (e.g, P4, S10) as described here: + https://azure.microsoft.com/en-us/pricing/details/managed-disks/. Does not apply to Ultra + disks. + :type tier: str + :param bursting_enabled: Set to true to enable bursting beyond the provisioned performance + target of the disk. Bursting is disabled by default. Does not apply to Ultra disks. + :type bursting_enabled: bool """ _validation = { @@ -245,7 +387,14 @@ class Gallery(Resource): 'name': {'readonly': True}, 'type': {'readonly': True}, 'location': {'required': True}, + 'managed_by': {'readonly': True}, + 'managed_by_extended': {'readonly': True}, + 'time_created': {'readonly': True}, + 'disk_size_bytes': {'readonly': True}, + 'unique_id': {'readonly': True}, 'provisioning_state': {'readonly': True}, + 'disk_state': {'readonly': True}, + 'share_info': {'readonly': True}, } _attribute_map = { @@ -254,25 +403,71 @@ class Gallery(Resource): 'type': {'key': 'type', 'type': 'str'}, 'location': {'key': 'location', 'type': 'str'}, 'tags': {'key': 'tags', 'type': '{str}'}, - 'description': {'key': 'properties.description', 'type': 'str'}, - 'identifier': {'key': 'properties.identifier', 'type': 'GalleryIdentifier'}, + 'managed_by': {'key': 'managedBy', 'type': 'str'}, + 'managed_by_extended': {'key': 'managedByExtended', 'type': '[str]'}, + 'sku': {'key': 'sku', 'type': 'DiskSku'}, + 'zones': {'key': 'zones', 'type': '[str]'}, + 'extended_location': {'key': 'extendedLocation', 'type': 'ExtendedLocation'}, + 'time_created': {'key': 'properties.timeCreated', 'type': 'iso-8601'}, + 'os_type': {'key': 'properties.osType', 'type': 'str'}, + 'hyper_v_generation': {'key': 'properties.hyperVGeneration', 'type': 'str'}, + 'purchase_plan': {'key': 'properties.purchasePlan', 'type': 'PurchasePlan'}, + 'creation_data': {'key': 'properties.creationData', 'type': 'CreationData'}, + 'disk_size_gb': {'key': 'properties.diskSizeGB', 'type': 'int'}, + 'disk_size_bytes': {'key': 'properties.diskSizeBytes', 'type': 'long'}, + 'unique_id': {'key': 'properties.uniqueId', 'type': 'str'}, + 'encryption_settings_collection': {'key': 'properties.encryptionSettingsCollection', 'type': 'EncryptionSettingsCollection'}, 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, - 'sharing_profile': {'key': 'properties.sharingProfile', 'type': 'SharingProfile'}, + 'disk_iops_read_write': {'key': 'properties.diskIOPSReadWrite', 'type': 'long'}, + 'disk_m_bps_read_write': {'key': 'properties.diskMBpsReadWrite', 'type': 'long'}, + 'disk_iops_read_only': {'key': 'properties.diskIOPSReadOnly', 'type': 'long'}, + 'disk_m_bps_read_only': {'key': 'properties.diskMBpsReadOnly', 'type': 'long'}, + 'disk_state': {'key': 'properties.diskState', 'type': 'str'}, + 'encryption': {'key': 'properties.encryption', 'type': 'Encryption'}, + 'max_shares': {'key': 'properties.maxShares', 'type': 'int'}, + 'share_info': {'key': 'properties.shareInfo', 'type': '[ShareInfoElement]'}, + 'network_access_policy': {'key': 'properties.networkAccessPolicy', 'type': 'str'}, + 'disk_access_id': {'key': 'properties.diskAccessId', 'type': 'str'}, + 'tier': {'key': 'properties.tier', 'type': 'str'}, + 'bursting_enabled': {'key': 'properties.burstingEnabled', 'type': 'bool'}, } def __init__( self, **kwargs ): - super(Gallery, self).__init__(**kwargs) - self.description = kwargs.get('description', None) - self.identifier = kwargs.get('identifier', None) + super(Disk, self).__init__(**kwargs) + self.managed_by = None + self.managed_by_extended = None + self.sku = kwargs.get('sku', None) + self.zones = kwargs.get('zones', None) + self.extended_location = kwargs.get('extended_location', None) + self.time_created = None + self.os_type = kwargs.get('os_type', None) + self.hyper_v_generation = kwargs.get('hyper_v_generation', None) + self.purchase_plan = kwargs.get('purchase_plan', None) + self.creation_data = kwargs.get('creation_data', None) + self.disk_size_gb = kwargs.get('disk_size_gb', None) + self.disk_size_bytes = None + self.unique_id = None + self.encryption_settings_collection = kwargs.get('encryption_settings_collection', None) self.provisioning_state = None - self.sharing_profile = kwargs.get('sharing_profile', None) + self.disk_iops_read_write = kwargs.get('disk_iops_read_write', None) + self.disk_m_bps_read_write = kwargs.get('disk_m_bps_read_write', None) + self.disk_iops_read_only = kwargs.get('disk_iops_read_only', None) + self.disk_m_bps_read_only = kwargs.get('disk_m_bps_read_only', None) + self.disk_state = None + self.encryption = kwargs.get('encryption', None) + self.max_shares = kwargs.get('max_shares', None) + self.share_info = None + self.network_access_policy = kwargs.get('network_access_policy', None) + self.disk_access_id = kwargs.get('disk_access_id', None) + self.tier = kwargs.get('tier', None) + self.bursting_enabled = kwargs.get('bursting_enabled', None) -class GalleryApplication(Resource): - """Specifies information about the gallery Application Definition that you want to create or update. +class DiskAccess(Resource): + """disk access resource. Variables are only populated by the server, and will be ignored when sending a request. @@ -288,23 +483,14 @@ class GalleryApplication(Resource): :type location: str :param tags: A set of tags. Resource tags. :type tags: dict[str, str] - :param description: The description of this gallery Application Definition resource. This - property is updatable. - :type description: str - :param eula: The Eula agreement for the gallery Application Definition. - :type eula: str - :param privacy_statement_uri: The privacy statement uri. - :type privacy_statement_uri: str - :param release_note_uri: The release note uri. - :type release_note_uri: str - :param end_of_life_date: The end of life date of the gallery Application Definition. This - property can be used for decommissioning purposes. This property is updatable. - :type end_of_life_date: ~datetime.datetime - :param supported_os_type: This property allows you to specify the supported type of the OS that - application is built for. :code:`
`:code:`
` Possible values are: - :code:`
`:code:`
` **Windows** :code:`
`:code:`
` **Linux**. Possible values - include: "Windows", "Linux". - :type supported_os_type: str or ~azure.mgmt.compute.v2020_09_30.models.OperatingSystemTypes + :ivar private_endpoint_connections: A readonly collection of private endpoint connections + created on the disk. Currently only one endpoint connection is supported. + :vartype private_endpoint_connections: + list[~azure.mgmt.compute.v2020_09_30.models.PrivateEndpointConnection] + :ivar provisioning_state: The disk access resource provisioning state. + :vartype provisioning_state: str + :ivar time_created: The time when the disk access was created. + :vartype time_created: ~datetime.datetime """ _validation = { @@ -312,6 +498,9 @@ class GalleryApplication(Resource): 'name': {'readonly': True}, 'type': {'readonly': True}, 'location': {'required': True}, + 'private_endpoint_connections': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + 'time_created': {'readonly': True}, } _attribute_map = { @@ -320,36 +509,30 @@ class GalleryApplication(Resource): 'type': {'key': 'type', 'type': 'str'}, 'location': {'key': 'location', 'type': 'str'}, 'tags': {'key': 'tags', 'type': '{str}'}, - 'description': {'key': 'properties.description', 'type': 'str'}, - 'eula': {'key': 'properties.eula', 'type': 'str'}, - 'privacy_statement_uri': {'key': 'properties.privacyStatementUri', 'type': 'str'}, - 'release_note_uri': {'key': 'properties.releaseNoteUri', 'type': 'str'}, - 'end_of_life_date': {'key': 'properties.endOfLifeDate', 'type': 'iso-8601'}, - 'supported_os_type': {'key': 'properties.supportedOSType', 'type': 'str'}, + 'private_endpoint_connections': {'key': 'properties.privateEndpointConnections', 'type': '[PrivateEndpointConnection]'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'time_created': {'key': 'properties.timeCreated', 'type': 'iso-8601'}, } def __init__( self, **kwargs ): - super(GalleryApplication, self).__init__(**kwargs) - self.description = kwargs.get('description', None) - self.eula = kwargs.get('eula', None) - self.privacy_statement_uri = kwargs.get('privacy_statement_uri', None) - self.release_note_uri = kwargs.get('release_note_uri', None) - self.end_of_life_date = kwargs.get('end_of_life_date', None) - self.supported_os_type = kwargs.get('supported_os_type', None) + super(DiskAccess, self).__init__(**kwargs) + self.private_endpoint_connections = None + self.provisioning_state = None + self.time_created = None -class GalleryApplicationList(msrest.serialization.Model): - """The List Gallery Applications operation response. +class DiskAccessList(msrest.serialization.Model): + """The List disk access operation response. All required parameters must be populated in order to send to Azure. - :param value: Required. A list of Gallery Applications. - :type value: list[~azure.mgmt.compute.v2020_09_30.models.GalleryApplication] - :param next_link: The uri to fetch the next page of Application Definitions in the Application - Gallery. Call ListNext() with this to fetch the next page of gallery Application Definitions. + :param value: Required. A list of disk access resources. + :type value: list[~azure.mgmt.compute.v2020_09_30.models.DiskAccess] + :param next_link: The uri to fetch the next page of disk access resources. Call ListNext() with + this to fetch the next page of disk access resources. :type next_link: str """ @@ -358,7 +541,7 @@ class GalleryApplicationList(msrest.serialization.Model): } _attribute_map = { - 'value': {'key': 'value', 'type': '[GalleryApplication]'}, + 'value': {'key': 'value', 'type': '[DiskAccess]'}, 'next_link': {'key': 'nextLink', 'type': 'str'}, } @@ -366,36 +549,19 @@ def __init__( self, **kwargs ): - super(GalleryApplicationList, self).__init__(**kwargs) + super(DiskAccessList, self).__init__(**kwargs) self.value = kwargs['value'] self.next_link = kwargs.get('next_link', None) -class UpdateResourceDefinition(msrest.serialization.Model): - """The Update Resource model definition. - - Variables are only populated by the server, and will be ignored when sending a request. +class DiskAccessUpdate(msrest.serialization.Model): + """Used for updating a disk access resource. - :ivar id: Resource Id. - :vartype id: str - :ivar name: Resource name. - :vartype name: str - :ivar type: Resource type. - :vartype type: str :param tags: A set of tags. Resource tags. :type tags: dict[str, str] """ - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - } - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, 'tags': {'key': 'tags', 'type': '{str}'}, } @@ -403,79 +569,12 @@ def __init__( self, **kwargs ): - super(UpdateResourceDefinition, self).__init__(**kwargs) - self.id = None - self.name = None - self.type = None + super(DiskAccessUpdate, self).__init__(**kwargs) self.tags = kwargs.get('tags', None) -class GalleryApplicationUpdate(UpdateResourceDefinition): - """Specifies information about the gallery Application Definition that you want to update. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Resource Id. - :vartype id: str - :ivar name: Resource name. - :vartype name: str - :ivar type: Resource type. - :vartype type: str - :param tags: A set of tags. Resource tags. - :type tags: dict[str, str] - :param description: The description of this gallery Application Definition resource. This - property is updatable. - :type description: str - :param eula: The Eula agreement for the gallery Application Definition. - :type eula: str - :param privacy_statement_uri: The privacy statement uri. - :type privacy_statement_uri: str - :param release_note_uri: The release note uri. - :type release_note_uri: str - :param end_of_life_date: The end of life date of the gallery Application Definition. This - property can be used for decommissioning purposes. This property is updatable. - :type end_of_life_date: ~datetime.datetime - :param supported_os_type: This property allows you to specify the supported type of the OS that - application is built for. :code:`
`:code:`
` Possible values are: - :code:`
`:code:`
` **Windows** :code:`
`:code:`
` **Linux**. Possible values - include: "Windows", "Linux". - :type supported_os_type: str or ~azure.mgmt.compute.v2020_09_30.models.OperatingSystemTypes - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'description': {'key': 'properties.description', 'type': 'str'}, - 'eula': {'key': 'properties.eula', 'type': 'str'}, - 'privacy_statement_uri': {'key': 'properties.privacyStatementUri', 'type': 'str'}, - 'release_note_uri': {'key': 'properties.releaseNoteUri', 'type': 'str'}, - 'end_of_life_date': {'key': 'properties.endOfLifeDate', 'type': 'iso-8601'}, - 'supported_os_type': {'key': 'properties.supportedOSType', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(GalleryApplicationUpdate, self).__init__(**kwargs) - self.description = kwargs.get('description', None) - self.eula = kwargs.get('eula', None) - self.privacy_statement_uri = kwargs.get('privacy_statement_uri', None) - self.release_note_uri = kwargs.get('release_note_uri', None) - self.end_of_life_date = kwargs.get('end_of_life_date', None) - self.supported_os_type = kwargs.get('supported_os_type', None) - - -class GalleryApplicationVersion(Resource): - """Specifies information about the gallery Application Version that you want to create or update. +class DiskEncryptionSet(Resource): + """disk encryption set resource. Variables are only populated by the server, and will be ignored when sending a request. @@ -491,15 +590,20 @@ class GalleryApplicationVersion(Resource): :type location: str :param tags: A set of tags. Resource tags. :type tags: dict[str, str] - :param publishing_profile: The publishing profile of a gallery image version. - :type publishing_profile: - ~azure.mgmt.compute.v2020_09_30.models.GalleryApplicationVersionPublishingProfile - :ivar provisioning_state: The provisioning state, which only appears in the response. Possible - values include: "Creating", "Updating", "Failed", "Succeeded", "Deleting", "Migrating". - :vartype provisioning_state: str or - ~azure.mgmt.compute.v2020_09_30.models.GalleryApplicationVersionPropertiesProvisioningState - :ivar replication_status: This is the replication status of the gallery image version. - :vartype replication_status: ~azure.mgmt.compute.v2020_09_30.models.ReplicationStatus + :param identity: The managed identity for the disk encryption set. It should be given + permission on the key vault before it can be used to encrypt disks. + :type identity: ~azure.mgmt.compute.v2020_09_30.models.EncryptionSetIdentity + :param encryption_type: The type of key used to encrypt the data of the disk. Possible values + include: "EncryptionAtRestWithCustomerKey", "EncryptionAtRestWithPlatformAndCustomerKeys". + :type encryption_type: str or ~azure.mgmt.compute.v2020_09_30.models.DiskEncryptionSetType + :param active_key: The key vault key which is currently used by this disk encryption set. + :type active_key: ~azure.mgmt.compute.v2020_09_30.models.KeyForDiskEncryptionSet + :ivar previous_keys: A readonly collection of key vault keys previously used by this disk + encryption set while a key rotation is in progress. It will be empty if there is no ongoing key + rotation. + :vartype previous_keys: list[~azure.mgmt.compute.v2020_09_30.models.KeyForDiskEncryptionSet] + :ivar provisioning_state: The disk encryption set provisioning state. + :vartype provisioning_state: str """ _validation = { @@ -507,8 +611,8 @@ class GalleryApplicationVersion(Resource): 'name': {'readonly': True}, 'type': {'readonly': True}, 'location': {'required': True}, + 'previous_keys': {'readonly': True}, 'provisioning_state': {'readonly': True}, - 'replication_status': {'readonly': True}, } _attribute_map = { @@ -517,30 +621,34 @@ class GalleryApplicationVersion(Resource): 'type': {'key': 'type', 'type': 'str'}, 'location': {'key': 'location', 'type': 'str'}, 'tags': {'key': 'tags', 'type': '{str}'}, - 'publishing_profile': {'key': 'properties.publishingProfile', 'type': 'GalleryApplicationVersionPublishingProfile'}, + 'identity': {'key': 'identity', 'type': 'EncryptionSetIdentity'}, + 'encryption_type': {'key': 'properties.encryptionType', 'type': 'str'}, + 'active_key': {'key': 'properties.activeKey', 'type': 'KeyForDiskEncryptionSet'}, + 'previous_keys': {'key': 'properties.previousKeys', 'type': '[KeyForDiskEncryptionSet]'}, 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, - 'replication_status': {'key': 'properties.replicationStatus', 'type': 'ReplicationStatus'}, } def __init__( self, **kwargs ): - super(GalleryApplicationVersion, self).__init__(**kwargs) - self.publishing_profile = kwargs.get('publishing_profile', None) + super(DiskEncryptionSet, self).__init__(**kwargs) + self.identity = kwargs.get('identity', None) + self.encryption_type = kwargs.get('encryption_type', None) + self.active_key = kwargs.get('active_key', None) + self.previous_keys = None self.provisioning_state = None - self.replication_status = None -class GalleryApplicationVersionList(msrest.serialization.Model): - """The List Gallery Application version operation response. +class DiskEncryptionSetList(msrest.serialization.Model): + """The List disk encryption set operation response. All required parameters must be populated in order to send to Azure. - :param value: Required. A list of gallery Application Versions. - :type value: list[~azure.mgmt.compute.v2020_09_30.models.GalleryApplicationVersion] - :param next_link: The uri to fetch the next page of gallery Application Versions. Call - ListNext() with this to fetch the next page of gallery Application Versions. + :param value: Required. A list of disk encryption sets. + :type value: list[~azure.mgmt.compute.v2020_09_30.models.DiskEncryptionSet] + :param next_link: The uri to fetch the next page of disk encryption sets. Call ListNext() with + this to fetch the next page of disk encryption sets. :type next_link: str """ @@ -549,7 +657,7 @@ class GalleryApplicationVersionList(msrest.serialization.Model): } _attribute_map = { - 'value': {'key': 'value', 'type': '[GalleryApplicationVersion]'}, + 'value': {'key': 'value', 'type': '[DiskEncryptionSet]'}, 'next_link': {'key': 'nextLink', 'type': 'str'}, } @@ -557,126 +665,72 @@ def __init__( self, **kwargs ): - super(GalleryApplicationVersionList, self).__init__(**kwargs) + super(DiskEncryptionSetList, self).__init__(**kwargs) self.value = kwargs['value'] self.next_link = kwargs.get('next_link', None) -class GalleryArtifactPublishingProfileBase(msrest.serialization.Model): - """Describes the basic gallery artifact publishing profile. +class DiskEncryptionSetUpdate(msrest.serialization.Model): + """disk encryption set update resource. - Variables are only populated by the server, and will be ignored when sending a request. - - :param target_regions: The target regions where the Image Version is going to be replicated to. - This property is updatable. - :type target_regions: list[~azure.mgmt.compute.v2020_09_30.models.TargetRegion] - :param replica_count: The number of replicas of the Image Version to be created per region. - This property would take effect for a region when regionalReplicaCount is not specified. This - property is updatable. - :type replica_count: int - :param exclude_from_latest: If set to true, Virtual Machines deployed from the latest version - of the Image Definition won't use this Image Version. - :type exclude_from_latest: bool - :ivar published_date: The timestamp for when the gallery image version is published. - :vartype published_date: ~datetime.datetime - :param end_of_life_date: The end of life date of the gallery image version. This property can - be used for decommissioning purposes. This property is updatable. - :type end_of_life_date: ~datetime.datetime - :param storage_account_type: Specifies the storage account type to be used to store the image. - This property is not updatable. Possible values include: "Standard_LRS", "Standard_ZRS", - "Premium_LRS". - :type storage_account_type: str or ~azure.mgmt.compute.v2020_09_30.models.StorageAccountType - """ - - _validation = { - 'published_date': {'readonly': True}, - } + :param tags: A set of tags. Resource tags. + :type tags: dict[str, str] + :param encryption_type: The type of key used to encrypt the data of the disk. Possible values + include: "EncryptionAtRestWithCustomerKey", "EncryptionAtRestWithPlatformAndCustomerKeys". + :type encryption_type: str or ~azure.mgmt.compute.v2020_09_30.models.DiskEncryptionSetType + :param active_key: Key Vault Key Url to be used for server side encryption of Managed Disks and + Snapshots. + :type active_key: ~azure.mgmt.compute.v2020_09_30.models.KeyForDiskEncryptionSet + """ _attribute_map = { - 'target_regions': {'key': 'targetRegions', 'type': '[TargetRegion]'}, - 'replica_count': {'key': 'replicaCount', 'type': 'int'}, - 'exclude_from_latest': {'key': 'excludeFromLatest', 'type': 'bool'}, - 'published_date': {'key': 'publishedDate', 'type': 'iso-8601'}, - 'end_of_life_date': {'key': 'endOfLifeDate', 'type': 'iso-8601'}, - 'storage_account_type': {'key': 'storageAccountType', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'encryption_type': {'key': 'properties.encryptionType', 'type': 'str'}, + 'active_key': {'key': 'properties.activeKey', 'type': 'KeyForDiskEncryptionSet'}, } def __init__( self, **kwargs ): - super(GalleryArtifactPublishingProfileBase, self).__init__(**kwargs) - self.target_regions = kwargs.get('target_regions', None) - self.replica_count = kwargs.get('replica_count', None) - self.exclude_from_latest = kwargs.get('exclude_from_latest', None) - self.published_date = None - self.end_of_life_date = kwargs.get('end_of_life_date', None) - self.storage_account_type = kwargs.get('storage_account_type', None) - + super(DiskEncryptionSetUpdate, self).__init__(**kwargs) + self.tags = kwargs.get('tags', None) + self.encryption_type = kwargs.get('encryption_type', None) + self.active_key = kwargs.get('active_key', None) -class GalleryApplicationVersionPublishingProfile(GalleryArtifactPublishingProfileBase): - """The publishing profile of a gallery image version. - Variables are only populated by the server, and will be ignored when sending a request. +class DiskList(msrest.serialization.Model): + """The List Disks operation response. All required parameters must be populated in order to send to Azure. - :param target_regions: The target regions where the Image Version is going to be replicated to. - This property is updatable. - :type target_regions: list[~azure.mgmt.compute.v2020_09_30.models.TargetRegion] - :param replica_count: The number of replicas of the Image Version to be created per region. - This property would take effect for a region when regionalReplicaCount is not specified. This - property is updatable. - :type replica_count: int - :param exclude_from_latest: If set to true, Virtual Machines deployed from the latest version - of the Image Definition won't use this Image Version. - :type exclude_from_latest: bool - :ivar published_date: The timestamp for when the gallery image version is published. - :vartype published_date: ~datetime.datetime - :param end_of_life_date: The end of life date of the gallery image version. This property can - be used for decommissioning purposes. This property is updatable. - :type end_of_life_date: ~datetime.datetime - :param storage_account_type: Specifies the storage account type to be used to store the image. - This property is not updatable. Possible values include: "Standard_LRS", "Standard_ZRS", - "Premium_LRS". - :type storage_account_type: str or ~azure.mgmt.compute.v2020_09_30.models.StorageAccountType - :param source: Required. The source image from which the Image Version is going to be created. - :type source: ~azure.mgmt.compute.v2020_09_30.models.UserArtifactSource - :param manage_actions: - :type manage_actions: ~azure.mgmt.compute.v2020_09_30.models.UserArtifactManage - :param enable_health_check: Optional. Whether or not this application reports health. - :type enable_health_check: bool + :param value: Required. A list of disks. + :type value: list[~azure.mgmt.compute.v2020_09_30.models.Disk] + :param next_link: The uri to fetch the next page of disks. Call ListNext() with this to fetch + the next page of disks. + :type next_link: str """ _validation = { - 'published_date': {'readonly': True}, - 'source': {'required': True}, + 'value': {'required': True}, } _attribute_map = { - 'target_regions': {'key': 'targetRegions', 'type': '[TargetRegion]'}, - 'replica_count': {'key': 'replicaCount', 'type': 'int'}, - 'exclude_from_latest': {'key': 'excludeFromLatest', 'type': 'bool'}, - 'published_date': {'key': 'publishedDate', 'type': 'iso-8601'}, - 'end_of_life_date': {'key': 'endOfLifeDate', 'type': 'iso-8601'}, - 'storage_account_type': {'key': 'storageAccountType', 'type': 'str'}, - 'source': {'key': 'source', 'type': 'UserArtifactSource'}, - 'manage_actions': {'key': 'manageActions', 'type': 'UserArtifactManage'}, - 'enable_health_check': {'key': 'enableHealthCheck', 'type': 'bool'}, + 'value': {'key': 'value', 'type': '[Disk]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, } def __init__( self, **kwargs ): - super(GalleryApplicationVersionPublishingProfile, self).__init__(**kwargs) - self.source = kwargs['source'] - self.manage_actions = kwargs.get('manage_actions', None) - self.enable_health_check = kwargs.get('enable_health_check', None) + super(DiskList, self).__init__(**kwargs) + self.value = kwargs['value'] + self.next_link = kwargs.get('next_link', None) -class GalleryApplicationVersionUpdate(UpdateResourceDefinition): - """Specifies information about the gallery Application Version that you want to update. +class ProxyOnlyResource(msrest.serialization.Model): + """The ProxyOnly Resource model definition. Variables are only populated by the server, and will be ignored when sending a request. @@ -686,454 +740,471 @@ class GalleryApplicationVersionUpdate(UpdateResourceDefinition): :vartype name: str :ivar type: Resource type. :vartype type: str - :param tags: A set of tags. Resource tags. - :type tags: dict[str, str] - :param publishing_profile: The publishing profile of a gallery image version. - :type publishing_profile: - ~azure.mgmt.compute.v2020_09_30.models.GalleryApplicationVersionPublishingProfile - :ivar provisioning_state: The provisioning state, which only appears in the response. Possible - values include: "Creating", "Updating", "Failed", "Succeeded", "Deleting", "Migrating". - :vartype provisioning_state: str or - ~azure.mgmt.compute.v2020_09_30.models.GalleryApplicationVersionPropertiesProvisioningState - :ivar replication_status: This is the replication status of the gallery image version. - :vartype replication_status: ~azure.mgmt.compute.v2020_09_30.models.ReplicationStatus """ _validation = { 'id': {'readonly': True}, 'name': {'readonly': True}, 'type': {'readonly': True}, - 'provisioning_state': {'readonly': True}, - 'replication_status': {'readonly': True}, } _attribute_map = { 'id': {'key': 'id', 'type': 'str'}, 'name': {'key': 'name', 'type': 'str'}, 'type': {'key': 'type', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'publishing_profile': {'key': 'properties.publishingProfile', 'type': 'GalleryApplicationVersionPublishingProfile'}, - 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, - 'replication_status': {'key': 'properties.replicationStatus', 'type': 'ReplicationStatus'}, } def __init__( self, **kwargs ): - super(GalleryApplicationVersionUpdate, self).__init__(**kwargs) - self.publishing_profile = kwargs.get('publishing_profile', None) - self.provisioning_state = None - self.replication_status = None + super(ProxyOnlyResource, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None -class GalleryArtifactSource(msrest.serialization.Model): - """The source image from which the Image Version is going to be created. +class DiskRestorePoint(ProxyOnlyResource): + """Properties of disk restore point. - All required parameters must be populated in order to send to Azure. + Variables are only populated by the server, and will be ignored when sending a request. - :param managed_image: Required. The managed artifact. - :type managed_image: ~azure.mgmt.compute.v2020_09_30.models.ManagedArtifact + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :ivar time_created: The timestamp of restorePoint creation. + :vartype time_created: ~datetime.datetime + :ivar source_resource_id: arm id of source disk. + :vartype source_resource_id: str + :ivar os_type: The Operating System type. Possible values include: "Windows", "Linux". + :vartype os_type: str or ~azure.mgmt.compute.v2020_09_30.models.OperatingSystemTypes + :param hyper_v_generation: The hypervisor generation of the Virtual Machine. Applicable to OS + disks only. Possible values include: "V1", "V2". + :type hyper_v_generation: str or ~azure.mgmt.compute.v2020_09_30.models.HyperVGeneration + :param purchase_plan: Purchase plan information for the the image from which the OS disk was + created. + :type purchase_plan: ~azure.mgmt.compute.v2020_09_30.models.PurchasePlan + :ivar family_id: id of the backing snapshot's MIS family. + :vartype family_id: str + :ivar source_unique_id: unique incarnation id of the source disk. + :vartype source_unique_id: str + :ivar encryption: Encryption property can be used to encrypt data at rest with customer managed + keys or platform managed keys. + :vartype encryption: ~azure.mgmt.compute.v2020_09_30.models.Encryption """ _validation = { - 'managed_image': {'required': True}, + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'time_created': {'readonly': True}, + 'source_resource_id': {'readonly': True}, + 'os_type': {'readonly': True}, + 'family_id': {'readonly': True}, + 'source_unique_id': {'readonly': True}, + 'encryption': {'readonly': True}, } _attribute_map = { - 'managed_image': {'key': 'managedImage', 'type': 'ManagedArtifact'}, + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'time_created': {'key': 'properties.timeCreated', 'type': 'iso-8601'}, + 'source_resource_id': {'key': 'properties.sourceResourceId', 'type': 'str'}, + 'os_type': {'key': 'properties.osType', 'type': 'str'}, + 'hyper_v_generation': {'key': 'properties.hyperVGeneration', 'type': 'str'}, + 'purchase_plan': {'key': 'properties.purchasePlan', 'type': 'PurchasePlan'}, + 'family_id': {'key': 'properties.familyId', 'type': 'str'}, + 'source_unique_id': {'key': 'properties.sourceUniqueId', 'type': 'str'}, + 'encryption': {'key': 'properties.encryption', 'type': 'Encryption'}, } def __init__( self, **kwargs ): - super(GalleryArtifactSource, self).__init__(**kwargs) - self.managed_image = kwargs['managed_image'] + super(DiskRestorePoint, self).__init__(**kwargs) + self.time_created = None + self.source_resource_id = None + self.os_type = None + self.hyper_v_generation = kwargs.get('hyper_v_generation', None) + self.purchase_plan = kwargs.get('purchase_plan', None) + self.family_id = None + self.source_unique_id = None + self.encryption = None -class GalleryArtifactVersionSource(msrest.serialization.Model): - """The gallery artifact version source. +class DiskRestorePointList(msrest.serialization.Model): + """The List Disk Restore Points operation response. - :param id: The id of the gallery artifact version source. Can specify a disk uri, snapshot uri, - user image or storage account resource. - :type id: str - :param uri: The uri of the gallery artifact version source. Currently used to specify vhd/blob - source. - :type uri: str + All required parameters must be populated in order to send to Azure. + + :param value: Required. A list of disk restore points. + :type value: list[~azure.mgmt.compute.v2020_09_30.models.DiskRestorePoint] + :param next_link: The uri to fetch the next page of disk restore points. Call ListNext() with + this to fetch the next page of disk restore points. + :type next_link: str """ + _validation = { + 'value': {'required': True}, + } + _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'uri': {'key': 'uri', 'type': 'str'}, + 'value': {'key': 'value', 'type': '[DiskRestorePoint]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, } def __init__( self, **kwargs ): - super(GalleryArtifactVersionSource, self).__init__(**kwargs) - self.id = kwargs.get('id', None) - self.uri = kwargs.get('uri', None) + super(DiskRestorePointList, self).__init__(**kwargs) + self.value = kwargs['value'] + self.next_link = kwargs.get('next_link', None) -class GalleryDiskImage(msrest.serialization.Model): - """This is the disk image base class. +class DiskSku(msrest.serialization.Model): + """The disks sku name. Can be Standard_LRS, Premium_LRS, StandardSSD_LRS, or UltraSSD_LRS. Variables are only populated by the server, and will be ignored when sending a request. - :ivar size_in_gb: This property indicates the size of the VHD to be created. - :vartype size_in_gb: int - :param host_caching: The host caching of the disk. Valid values are 'None', 'ReadOnly', and - 'ReadWrite'. Possible values include: "None", "ReadOnly", "ReadWrite". - :type host_caching: str or ~azure.mgmt.compute.v2020_09_30.models.HostCaching - :param source: The gallery artifact version source. - :type source: ~azure.mgmt.compute.v2020_09_30.models.GalleryArtifactVersionSource + :param name: The sku name. Possible values include: "Standard_LRS", "Premium_LRS", + "StandardSSD_LRS", "UltraSSD_LRS". + :type name: str or ~azure.mgmt.compute.v2020_09_30.models.DiskStorageAccountTypes + :ivar tier: The sku tier. + :vartype tier: str """ _validation = { - 'size_in_gb': {'readonly': True}, + 'tier': {'readonly': True}, } _attribute_map = { - 'size_in_gb': {'key': 'sizeInGB', 'type': 'int'}, - 'host_caching': {'key': 'hostCaching', 'type': 'str'}, - 'source': {'key': 'source', 'type': 'GalleryArtifactVersionSource'}, + 'name': {'key': 'name', 'type': 'str'}, + 'tier': {'key': 'tier', 'type': 'str'}, } def __init__( self, **kwargs ): - super(GalleryDiskImage, self).__init__(**kwargs) - self.size_in_gb = None - self.host_caching = kwargs.get('host_caching', None) - self.source = kwargs.get('source', None) - - -class GalleryDataDiskImage(GalleryDiskImage): - """This is the data disk image. + super(DiskSku, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.tier = None - 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. +class DiskUpdate(msrest.serialization.Model): + """Disk update resource. - :ivar size_in_gb: This property indicates the size of the VHD to be created. - :vartype size_in_gb: int - :param host_caching: The host caching of the disk. Valid values are 'None', 'ReadOnly', and - 'ReadWrite'. Possible values include: "None", "ReadOnly", "ReadWrite". - :type host_caching: str or ~azure.mgmt.compute.v2020_09_30.models.HostCaching - :param source: The gallery artifact version source. - :type source: ~azure.mgmt.compute.v2020_09_30.models.GalleryArtifactVersionSource - :param lun: Required. This property specifies the logical unit number of the data disk. This - value is used to identify data disks within the Virtual Machine and therefore must be unique - for each data disk attached to the Virtual Machine. - :type lun: int + :param tags: A set of tags. Resource tags. + :type tags: dict[str, str] + :param sku: The disks sku name. Can be Standard_LRS, Premium_LRS, StandardSSD_LRS, or + UltraSSD_LRS. + :type sku: ~azure.mgmt.compute.v2020_09_30.models.DiskSku + :param os_type: the Operating System type. Possible values include: "Windows", "Linux". + :type os_type: str or ~azure.mgmt.compute.v2020_09_30.models.OperatingSystemTypes + :param disk_size_gb: If creationData.createOption is Empty, this field is mandatory and it + indicates the size of the disk to create. If this field is present for updates or creation with + other options, it indicates a resize. Resizes are only allowed if the disk is not attached to a + running VM, and can only increase the disk's size. + :type disk_size_gb: int + :param encryption_settings_collection: Encryption settings collection used be Azure Disk + Encryption, can contain multiple encryption settings per disk or snapshot. + :type encryption_settings_collection: + ~azure.mgmt.compute.v2020_09_30.models.EncryptionSettingsCollection + :param disk_iops_read_write: The number of IOPS allowed for this disk; only settable for + UltraSSD disks. One operation can transfer between 4k and 256k bytes. + :type disk_iops_read_write: long + :param disk_m_bps_read_write: The bandwidth allowed for this disk; only settable for UltraSSD + disks. MBps means millions of bytes per second - MB here uses the ISO notation, of powers of + 10. + :type disk_m_bps_read_write: long + :param disk_iops_read_only: The total number of IOPS that will be allowed across all VMs + mounting the shared disk as ReadOnly. One operation can transfer between 4k and 256k bytes. + :type disk_iops_read_only: long + :param disk_m_bps_read_only: The total throughput (MBps) that will be allowed across all VMs + mounting the shared disk as ReadOnly. MBps means millions of bytes per second - MB here uses + the ISO notation, of powers of 10. + :type disk_m_bps_read_only: long + :param max_shares: The maximum number of VMs that can attach to the disk at the same time. + Value greater than one indicates a disk that can be mounted on multiple VMs at the same time. + :type max_shares: int + :param encryption: Encryption property can be used to encrypt data at rest with customer + managed keys or platform managed keys. + :type encryption: ~azure.mgmt.compute.v2020_09_30.models.Encryption + :param network_access_policy: Policy for accessing the disk via network. Possible values + include: "AllowAll", "AllowPrivate", "DenyAll". + :type network_access_policy: str or ~azure.mgmt.compute.v2020_09_30.models.NetworkAccessPolicy + :param disk_access_id: ARM id of the DiskAccess resource for using private endpoints on disks. + :type disk_access_id: str + :param tier: Performance tier of the disk (e.g, P4, S10) as described here: + https://azure.microsoft.com/en-us/pricing/details/managed-disks/. Does not apply to Ultra + disks. + :type tier: str + :param bursting_enabled: Set to true to enable bursting beyond the provisioned performance + target of the disk. Bursting is disabled by default. Does not apply to Ultra disks. + :type bursting_enabled: bool + :param purchase_plan: Purchase plan information to be added on the OS disk. + :type purchase_plan: ~azure.mgmt.compute.v2020_09_30.models.PurchasePlan """ - _validation = { - 'size_in_gb': {'readonly': True}, - 'lun': {'required': True}, - } - _attribute_map = { - 'size_in_gb': {'key': 'sizeInGB', 'type': 'int'}, - 'host_caching': {'key': 'hostCaching', 'type': 'str'}, - 'source': {'key': 'source', 'type': 'GalleryArtifactVersionSource'}, - 'lun': {'key': 'lun', 'type': 'int'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'sku': {'key': 'sku', 'type': 'DiskSku'}, + 'os_type': {'key': 'properties.osType', 'type': 'str'}, + 'disk_size_gb': {'key': 'properties.diskSizeGB', 'type': 'int'}, + 'encryption_settings_collection': {'key': 'properties.encryptionSettingsCollection', 'type': 'EncryptionSettingsCollection'}, + 'disk_iops_read_write': {'key': 'properties.diskIOPSReadWrite', 'type': 'long'}, + 'disk_m_bps_read_write': {'key': 'properties.diskMBpsReadWrite', 'type': 'long'}, + 'disk_iops_read_only': {'key': 'properties.diskIOPSReadOnly', 'type': 'long'}, + 'disk_m_bps_read_only': {'key': 'properties.diskMBpsReadOnly', 'type': 'long'}, + 'max_shares': {'key': 'properties.maxShares', 'type': 'int'}, + 'encryption': {'key': 'properties.encryption', 'type': 'Encryption'}, + 'network_access_policy': {'key': 'properties.networkAccessPolicy', 'type': 'str'}, + 'disk_access_id': {'key': 'properties.diskAccessId', 'type': 'str'}, + 'tier': {'key': 'properties.tier', 'type': 'str'}, + 'bursting_enabled': {'key': 'properties.burstingEnabled', 'type': 'bool'}, + 'purchase_plan': {'key': 'properties.purchasePlan', 'type': 'PurchasePlan'}, } def __init__( self, **kwargs ): - super(GalleryDataDiskImage, self).__init__(**kwargs) - self.lun = kwargs['lun'] - + super(DiskUpdate, self).__init__(**kwargs) + self.tags = kwargs.get('tags', None) + self.sku = kwargs.get('sku', None) + self.os_type = kwargs.get('os_type', None) + self.disk_size_gb = kwargs.get('disk_size_gb', None) + self.encryption_settings_collection = kwargs.get('encryption_settings_collection', None) + self.disk_iops_read_write = kwargs.get('disk_iops_read_write', None) + self.disk_m_bps_read_write = kwargs.get('disk_m_bps_read_write', None) + self.disk_iops_read_only = kwargs.get('disk_iops_read_only', None) + self.disk_m_bps_read_only = kwargs.get('disk_m_bps_read_only', None) + self.max_shares = kwargs.get('max_shares', None) + self.encryption = kwargs.get('encryption', None) + self.network_access_policy = kwargs.get('network_access_policy', None) + self.disk_access_id = kwargs.get('disk_access_id', None) + self.tier = kwargs.get('tier', None) + self.bursting_enabled = kwargs.get('bursting_enabled', None) + self.purchase_plan = kwargs.get('purchase_plan', None) -class GalleryIdentifier(msrest.serialization.Model): - """Describes the gallery unique name. - Variables are only populated by the server, and will be ignored when sending a request. +class Encryption(msrest.serialization.Model): + """Encryption at rest settings for disk or snapshot. - :ivar unique_name: The unique name of the Shared Image Gallery. This name is generated - automatically by Azure. - :vartype unique_name: str + :param disk_encryption_set_id: ResourceId of the disk encryption set to use for enabling + encryption at rest. + :type disk_encryption_set_id: str + :param type: The type of key used to encrypt the data of the disk. Possible values include: + "EncryptionAtRestWithPlatformKey", "EncryptionAtRestWithCustomerKey", + "EncryptionAtRestWithPlatformAndCustomerKeys". + :type type: str or ~azure.mgmt.compute.v2020_09_30.models.EncryptionType """ - _validation = { - 'unique_name': {'readonly': True}, - } - _attribute_map = { - 'unique_name': {'key': 'uniqueName', 'type': 'str'}, + 'disk_encryption_set_id': {'key': 'diskEncryptionSetId', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, } def __init__( self, **kwargs ): - super(GalleryIdentifier, self).__init__(**kwargs) - self.unique_name = None + super(Encryption, self).__init__(**kwargs) + self.disk_encryption_set_id = kwargs.get('disk_encryption_set_id', None) + self.type = kwargs.get('type', None) -class GalleryImage(Resource): - """Specifies information about the gallery image definition that you want to create or update. +class EncryptionImages(msrest.serialization.Model): + """Optional. Allows users to provide customer managed keys for encrypting the OS and data disks in the gallery artifact. - Variables are only populated by the server, and will be ignored when sending a request. + :param os_disk_image: This is the disk image encryption base class. + :type os_disk_image: ~azure.mgmt.compute.v2020_09_30.models.DiskImageEncryption + :param data_disk_images: A list of encryption specifications for data disk images. + :type data_disk_images: list[~azure.mgmt.compute.v2020_09_30.models.DataDiskImageEncryption] + """ - All required parameters must be populated in order to send to Azure. + _attribute_map = { + 'os_disk_image': {'key': 'osDiskImage', 'type': 'DiskImageEncryption'}, + 'data_disk_images': {'key': 'dataDiskImages', 'type': '[DataDiskImageEncryption]'}, + } - :ivar id: Resource Id. - :vartype id: str - :ivar name: Resource name. - :vartype name: str - :ivar type: Resource type. - :vartype type: str - :param location: Required. Resource location. - :type location: str - :param tags: A set of tags. Resource tags. - :type tags: dict[str, str] - :param description: The description of this gallery image definition resource. This property is - updatable. - :type description: str - :param eula: The Eula agreement for the gallery image definition. - :type eula: str - :param privacy_statement_uri: The privacy statement uri. - :type privacy_statement_uri: str - :param release_note_uri: The release note uri. - :type release_note_uri: str - :param os_type: This property allows you to specify the type of the OS that is included in the - disk when creating a VM from a managed image. :code:`
`:code:`
` Possible values are: - :code:`
`:code:`
` **Windows** :code:`
`:code:`
` **Linux**. Possible values - include: "Windows", "Linux". - :type os_type: str or ~azure.mgmt.compute.v2020_09_30.models.OperatingSystemTypes - :param os_state: This property allows the user to specify whether the virtual machines created - under this image are 'Generalized' or 'Specialized'. Possible values include: "Generalized", - "Specialized". - :type os_state: str or ~azure.mgmt.compute.v2020_09_30.models.OperatingSystemStateTypes - :param hyper_v_generation: The hypervisor generation of the Virtual Machine. Applicable to OS - disks only. Possible values include: "V1", "V2". - :type hyper_v_generation: str or ~azure.mgmt.compute.v2020_09_30.models.HyperVGeneration - :param features: A list of gallery image features. - :type features: list[~azure.mgmt.compute.v2020_09_30.models.GalleryImageFeature] - :param end_of_life_date: The end of life date of the gallery image definition. This property - can be used for decommissioning purposes. This property is updatable. - :type end_of_life_date: ~datetime.datetime - :param identifier: This is the gallery image definition identifier. - :type identifier: ~azure.mgmt.compute.v2020_09_30.models.GalleryImageIdentifier - :param recommended: The properties describe the recommended machine configuration for this - Image Definition. These properties are updatable. - :type recommended: ~azure.mgmt.compute.v2020_09_30.models.RecommendedMachineConfiguration - :param disallowed: Describes the disallowed disk types. - :type disallowed: ~azure.mgmt.compute.v2020_09_30.models.Disallowed - :param purchase_plan: Describes the gallery image definition purchase plan. This is used by - marketplace images. - :type purchase_plan: ~azure.mgmt.compute.v2020_09_30.models.ImagePurchasePlan - :ivar provisioning_state: The provisioning state, which only appears in the response. Possible - values include: "Creating", "Updating", "Failed", "Succeeded", "Deleting", "Migrating". - :vartype provisioning_state: str or - ~azure.mgmt.compute.v2020_09_30.models.GalleryImagePropertiesProvisioningState + def __init__( + self, + **kwargs + ): + super(EncryptionImages, self).__init__(**kwargs) + self.os_disk_image = kwargs.get('os_disk_image', None) + self.data_disk_images = kwargs.get('data_disk_images', None) + + +class EncryptionSetIdentity(msrest.serialization.Model): + """The managed identity for the disk encryption set. It should be given permission on the key vault before it can be used to encrypt disks. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param type: The type of Managed Identity used by the DiskEncryptionSet. Only SystemAssigned is + supported for new creations. Disk Encryption Sets can be updated with Identity type None during + migration of subscription to a new Azure Active Directory tenant; it will cause the encrypted + resources to lose access to the keys. Possible values include: "SystemAssigned", "None". + :type type: str or ~azure.mgmt.compute.v2020_09_30.models.DiskEncryptionSetIdentityType + :ivar principal_id: The object id of the Managed Identity Resource. This will be sent to the RP + from ARM via the x-ms-identity-principal-id header in the PUT request if the resource has a + systemAssigned(implicit) identity. + :vartype principal_id: str + :ivar tenant_id: The tenant id of the Managed Identity Resource. This will be sent to the RP + from ARM via the x-ms-client-tenant-id header in the PUT request if the resource has a + systemAssigned(implicit) identity. + :vartype tenant_id: str """ _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'location': {'required': True}, - 'provisioning_state': {'readonly': True}, + 'principal_id': {'readonly': True}, + 'tenant_id': {'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}'}, - 'description': {'key': 'properties.description', 'type': 'str'}, - 'eula': {'key': 'properties.eula', 'type': 'str'}, - 'privacy_statement_uri': {'key': 'properties.privacyStatementUri', 'type': 'str'}, - 'release_note_uri': {'key': 'properties.releaseNoteUri', 'type': 'str'}, - 'os_type': {'key': 'properties.osType', 'type': 'str'}, - 'os_state': {'key': 'properties.osState', 'type': 'str'}, - 'hyper_v_generation': {'key': 'properties.hyperVGeneration', 'type': 'str'}, - 'features': {'key': 'properties.features', 'type': '[GalleryImageFeature]'}, - 'end_of_life_date': {'key': 'properties.endOfLifeDate', 'type': 'iso-8601'}, - 'identifier': {'key': 'properties.identifier', 'type': 'GalleryImageIdentifier'}, - 'recommended': {'key': 'properties.recommended', 'type': 'RecommendedMachineConfiguration'}, - 'disallowed': {'key': 'properties.disallowed', 'type': 'Disallowed'}, - 'purchase_plan': {'key': 'properties.purchasePlan', 'type': 'ImagePurchasePlan'}, - 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'principal_id': {'key': 'principalId', 'type': 'str'}, + 'tenant_id': {'key': 'tenantId', 'type': 'str'}, } def __init__( self, **kwargs ): - super(GalleryImage, self).__init__(**kwargs) - self.description = kwargs.get('description', None) - self.eula = kwargs.get('eula', None) - self.privacy_statement_uri = kwargs.get('privacy_statement_uri', None) - self.release_note_uri = kwargs.get('release_note_uri', None) - self.os_type = kwargs.get('os_type', None) - self.os_state = kwargs.get('os_state', None) - self.hyper_v_generation = kwargs.get('hyper_v_generation', None) - self.features = kwargs.get('features', None) - self.end_of_life_date = kwargs.get('end_of_life_date', None) - self.identifier = kwargs.get('identifier', None) - self.recommended = kwargs.get('recommended', None) - self.disallowed = kwargs.get('disallowed', None) - self.purchase_plan = kwargs.get('purchase_plan', None) - self.provisioning_state = None + super(EncryptionSetIdentity, self).__init__(**kwargs) + self.type = kwargs.get('type', None) + self.principal_id = None + self.tenant_id = None -class GalleryImageFeature(msrest.serialization.Model): - """A feature for gallery image. +class EncryptionSettingsCollection(msrest.serialization.Model): + """Encryption settings for disk or snapshot. - :param name: The name of the gallery image feature. - :type name: str - :param value: The value of the gallery image feature. - :type value: str + All required parameters must be populated in order to send to Azure. + + :param enabled: Required. Set this flag to true and provide DiskEncryptionKey and optional + KeyEncryptionKey to enable encryption. Set this flag to false and remove DiskEncryptionKey and + KeyEncryptionKey to disable encryption. If EncryptionSettings is null in the request object, + the existing settings remain unchanged. + :type enabled: bool + :param encryption_settings: A collection of encryption settings, one for each disk volume. + :type encryption_settings: + list[~azure.mgmt.compute.v2020_09_30.models.EncryptionSettingsElement] + :param encryption_settings_version: Describes what type of encryption is used for the disks. + Once this field is set, it cannot be overwritten. '1.0' corresponds to Azure Disk Encryption + with AAD app.'1.1' corresponds to Azure Disk Encryption. + :type encryption_settings_version: str """ + _validation = { + 'enabled': {'required': True}, + } + _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'value': {'key': 'value', 'type': 'str'}, + 'enabled': {'key': 'enabled', 'type': 'bool'}, + 'encryption_settings': {'key': 'encryptionSettings', 'type': '[EncryptionSettingsElement]'}, + 'encryption_settings_version': {'key': 'encryptionSettingsVersion', 'type': 'str'}, } def __init__( self, **kwargs ): - super(GalleryImageFeature, self).__init__(**kwargs) - self.name = kwargs.get('name', None) - self.value = kwargs.get('value', None) + super(EncryptionSettingsCollection, self).__init__(**kwargs) + self.enabled = kwargs['enabled'] + self.encryption_settings = kwargs.get('encryption_settings', None) + self.encryption_settings_version = kwargs.get('encryption_settings_version', None) -class GalleryImageIdentifier(msrest.serialization.Model): - """This is the gallery image definition identifier. - - All required parameters must be populated in order to send to Azure. +class EncryptionSettingsElement(msrest.serialization.Model): + """Encryption settings for one disk volume. - :param publisher: Required. The name of the gallery image definition publisher. - :type publisher: str - :param offer: Required. The name of the gallery image definition offer. - :type offer: str - :param sku: Required. The name of the gallery image definition SKU. - :type sku: str + :param disk_encryption_key: Key Vault Secret Url and vault id of the disk encryption key. + :type disk_encryption_key: ~azure.mgmt.compute.v2020_09_30.models.KeyVaultAndSecretReference + :param key_encryption_key: Key Vault Key Url and vault id of the key encryption key. + KeyEncryptionKey is optional and when provided is used to unwrap the disk encryption key. + :type key_encryption_key: ~azure.mgmt.compute.v2020_09_30.models.KeyVaultAndKeyReference """ - _validation = { - 'publisher': {'required': True}, - 'offer': {'required': True}, - 'sku': {'required': True}, - } - _attribute_map = { - 'publisher': {'key': 'publisher', 'type': 'str'}, - 'offer': {'key': 'offer', 'type': 'str'}, - 'sku': {'key': 'sku', 'type': 'str'}, + 'disk_encryption_key': {'key': 'diskEncryptionKey', 'type': 'KeyVaultAndSecretReference'}, + 'key_encryption_key': {'key': 'keyEncryptionKey', 'type': 'KeyVaultAndKeyReference'}, } def __init__( self, **kwargs ): - super(GalleryImageIdentifier, self).__init__(**kwargs) - self.publisher = kwargs['publisher'] - self.offer = kwargs['offer'] - self.sku = kwargs['sku'] - + super(EncryptionSettingsElement, self).__init__(**kwargs) + self.disk_encryption_key = kwargs.get('disk_encryption_key', None) + self.key_encryption_key = kwargs.get('key_encryption_key', None) -class GalleryImageList(msrest.serialization.Model): - """The List Gallery Images operation response. - All required parameters must be populated in order to send to Azure. +class ExtendedLocation(msrest.serialization.Model): + """The complex type of the extended location. - :param value: Required. A list of Shared Image Gallery images. - :type value: list[~azure.mgmt.compute.v2020_09_30.models.GalleryImage] - :param next_link: The uri to fetch the next page of Image Definitions in the Shared Image - Gallery. Call ListNext() with this to fetch the next page of gallery image definitions. - :type next_link: str + :param name: The name of the extended location. + :type name: str + :param type: The type of the extended location. Possible values include: "EdgeZone". + :type type: str or ~azure.mgmt.compute.v2020_09_30.models.ExtendedLocationTypes """ - _validation = { - 'value': {'required': True}, - } - _attribute_map = { - 'value': {'key': 'value', 'type': '[GalleryImage]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, } def __init__( self, **kwargs ): - super(GalleryImageList, self).__init__(**kwargs) - self.value = kwargs['value'] - self.next_link = kwargs.get('next_link', None) + super(ExtendedLocation, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.type = kwargs.get('type', None) -class GalleryImageUpdate(UpdateResourceDefinition): - """Specifies information about the gallery image definition that you want to update. +class Gallery(Resource): + """Specifies information about the Shared Image Gallery that you want to create or update. 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: Resource Id. :vartype id: str :ivar name: Resource name. :vartype name: str :ivar type: Resource type. :vartype type: str + :param location: Required. Resource location. + :type location: str :param tags: A set of tags. Resource tags. :type tags: dict[str, str] - :param description: The description of this gallery image definition resource. This property is + :param description: The description of this Shared Image Gallery resource. This property is updatable. :type description: str - :param eula: The Eula agreement for the gallery image definition. - :type eula: str - :param privacy_statement_uri: The privacy statement uri. - :type privacy_statement_uri: str - :param release_note_uri: The release note uri. - :type release_note_uri: str - :param os_type: This property allows you to specify the type of the OS that is included in the - disk when creating a VM from a managed image. :code:`
`:code:`
` Possible values are: - :code:`
`:code:`
` **Windows** :code:`
`:code:`
` **Linux**. Possible values - include: "Windows", "Linux". - :type os_type: str or ~azure.mgmt.compute.v2020_09_30.models.OperatingSystemTypes - :param os_state: This property allows the user to specify whether the virtual machines created - under this image are 'Generalized' or 'Specialized'. Possible values include: "Generalized", - "Specialized". - :type os_state: str or ~azure.mgmt.compute.v2020_09_30.models.OperatingSystemStateTypes - :param hyper_v_generation: The hypervisor generation of the Virtual Machine. Applicable to OS - disks only. Possible values include: "V1", "V2". - :type hyper_v_generation: str or ~azure.mgmt.compute.v2020_09_30.models.HyperVGeneration - :param features: A list of gallery image features. - :type features: list[~azure.mgmt.compute.v2020_09_30.models.GalleryImageFeature] - :param end_of_life_date: The end of life date of the gallery image definition. This property - can be used for decommissioning purposes. This property is updatable. - :type end_of_life_date: ~datetime.datetime - :param identifier: This is the gallery image definition identifier. - :type identifier: ~azure.mgmt.compute.v2020_09_30.models.GalleryImageIdentifier - :param recommended: The properties describe the recommended machine configuration for this - Image Definition. These properties are updatable. - :type recommended: ~azure.mgmt.compute.v2020_09_30.models.RecommendedMachineConfiguration - :param disallowed: Describes the disallowed disk types. - :type disallowed: ~azure.mgmt.compute.v2020_09_30.models.Disallowed - :param purchase_plan: Describes the gallery image definition purchase plan. This is used by - marketplace images. - :type purchase_plan: ~azure.mgmt.compute.v2020_09_30.models.ImagePurchasePlan + :param identifier: Describes the gallery unique name. + :type identifier: ~azure.mgmt.compute.v2020_09_30.models.GalleryIdentifier :ivar provisioning_state: The provisioning state, which only appears in the response. Possible values include: "Creating", "Updating", "Failed", "Succeeded", "Deleting", "Migrating". :vartype provisioning_state: str or - ~azure.mgmt.compute.v2020_09_30.models.GalleryImagePropertiesProvisioningState + ~azure.mgmt.compute.v2020_09_30.models.GalleryPropertiesProvisioningState + :param sharing_profile: Profile for gallery sharing to subscription or tenant. + :type sharing_profile: ~azure.mgmt.compute.v2020_09_30.models.SharingProfile """ _validation = { 'id': {'readonly': True}, 'name': {'readonly': True}, 'type': {'readonly': True}, + 'location': {'required': True}, 'provisioning_state': {'readonly': True}, } @@ -1141,46 +1212,27 @@ class GalleryImageUpdate(UpdateResourceDefinition): '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}'}, 'description': {'key': 'properties.description', 'type': 'str'}, - 'eula': {'key': 'properties.eula', 'type': 'str'}, - 'privacy_statement_uri': {'key': 'properties.privacyStatementUri', 'type': 'str'}, - 'release_note_uri': {'key': 'properties.releaseNoteUri', 'type': 'str'}, - 'os_type': {'key': 'properties.osType', 'type': 'str'}, - 'os_state': {'key': 'properties.osState', 'type': 'str'}, - 'hyper_v_generation': {'key': 'properties.hyperVGeneration', 'type': 'str'}, - 'features': {'key': 'properties.features', 'type': '[GalleryImageFeature]'}, - 'end_of_life_date': {'key': 'properties.endOfLifeDate', 'type': 'iso-8601'}, - 'identifier': {'key': 'properties.identifier', 'type': 'GalleryImageIdentifier'}, - 'recommended': {'key': 'properties.recommended', 'type': 'RecommendedMachineConfiguration'}, - 'disallowed': {'key': 'properties.disallowed', 'type': 'Disallowed'}, - 'purchase_plan': {'key': 'properties.purchasePlan', 'type': 'ImagePurchasePlan'}, + 'identifier': {'key': 'properties.identifier', 'type': 'GalleryIdentifier'}, 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'sharing_profile': {'key': 'properties.sharingProfile', 'type': 'SharingProfile'}, } def __init__( self, **kwargs ): - super(GalleryImageUpdate, self).__init__(**kwargs) + super(Gallery, self).__init__(**kwargs) self.description = kwargs.get('description', None) - self.eula = kwargs.get('eula', None) - self.privacy_statement_uri = kwargs.get('privacy_statement_uri', None) - self.release_note_uri = kwargs.get('release_note_uri', None) - self.os_type = kwargs.get('os_type', None) - self.os_state = kwargs.get('os_state', None) - self.hyper_v_generation = kwargs.get('hyper_v_generation', None) - self.features = kwargs.get('features', None) - self.end_of_life_date = kwargs.get('end_of_life_date', None) self.identifier = kwargs.get('identifier', None) - self.recommended = kwargs.get('recommended', None) - self.disallowed = kwargs.get('disallowed', None) - self.purchase_plan = kwargs.get('purchase_plan', None) self.provisioning_state = None + self.sharing_profile = kwargs.get('sharing_profile', None) -class GalleryImageVersion(Resource): - """Specifies information about the gallery image version that you want to create or update. +class GalleryApplication(Resource): + """Specifies information about the gallery Application Definition that you want to create or update. Variables are only populated by the server, and will be ignored when sending a request. @@ -1196,273 +1248,1569 @@ class GalleryImageVersion(Resource): :type location: str :param tags: A set of tags. Resource tags. :type tags: dict[str, str] - :param publishing_profile: Describes the basic gallery artifact publishing profile. - :type publishing_profile: - ~azure.mgmt.compute.v2020_09_30.models.GalleryArtifactPublishingProfileBase - :ivar provisioning_state: The provisioning state, which only appears in the response. Possible - values include: "Creating", "Updating", "Failed", "Succeeded", "Deleting", "Migrating". - :vartype provisioning_state: str or - ~azure.mgmt.compute.v2020_09_30.models.GalleryImageVersionPropertiesProvisioningState - :param storage_profile: This is the storage profile of a Gallery Image Version. - :type storage_profile: ~azure.mgmt.compute.v2020_09_30.models.GalleryImageVersionStorageProfile - :ivar replication_status: This is the replication status of the gallery image version. - :vartype replication_status: ~azure.mgmt.compute.v2020_09_30.models.ReplicationStatus + :param description: The description of this gallery Application Definition resource. This + property is updatable. + :type description: str + :param eula: The Eula agreement for the gallery Application Definition. + :type eula: str + :param privacy_statement_uri: The privacy statement uri. + :type privacy_statement_uri: str + :param release_note_uri: The release note uri. + :type release_note_uri: str + :param end_of_life_date: The end of life date of the gallery Application Definition. This + property can be used for decommissioning purposes. This property is updatable. + :type end_of_life_date: ~datetime.datetime + :param supported_os_type: This property allows you to specify the supported type of the OS that + application is built for. :code:`
`:code:`
` Possible values are: + :code:`
`:code:`
` **Windows** :code:`
`:code:`
` **Linux**. Possible values + include: "Windows", "Linux". + :type supported_os_type: str or ~azure.mgmt.compute.v2020_09_30.models.OperatingSystemTypes + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': 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}'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + 'eula': {'key': 'properties.eula', 'type': 'str'}, + 'privacy_statement_uri': {'key': 'properties.privacyStatementUri', 'type': 'str'}, + 'release_note_uri': {'key': 'properties.releaseNoteUri', 'type': 'str'}, + 'end_of_life_date': {'key': 'properties.endOfLifeDate', 'type': 'iso-8601'}, + 'supported_os_type': {'key': 'properties.supportedOSType', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(GalleryApplication, self).__init__(**kwargs) + self.description = kwargs.get('description', None) + self.eula = kwargs.get('eula', None) + self.privacy_statement_uri = kwargs.get('privacy_statement_uri', None) + self.release_note_uri = kwargs.get('release_note_uri', None) + self.end_of_life_date = kwargs.get('end_of_life_date', None) + self.supported_os_type = kwargs.get('supported_os_type', None) + + +class GalleryApplicationList(msrest.serialization.Model): + """The List Gallery Applications operation response. + + All required parameters must be populated in order to send to Azure. + + :param value: Required. A list of Gallery Applications. + :type value: list[~azure.mgmt.compute.v2020_09_30.models.GalleryApplication] + :param next_link: The uri to fetch the next page of Application Definitions in the Application + Gallery. Call ListNext() with this to fetch the next page of gallery Application Definitions. + :type next_link: str + """ + + _validation = { + 'value': {'required': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[GalleryApplication]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(GalleryApplicationList, self).__init__(**kwargs) + self.value = kwargs['value'] + self.next_link = kwargs.get('next_link', None) + + +class UpdateResourceDefinition(msrest.serialization.Model): + """The Update Resource model definition. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param tags: A set of tags. Resource tags. + :type tags: dict[str, str] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__( + self, + **kwargs + ): + super(UpdateResourceDefinition, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None + self.tags = kwargs.get('tags', None) + + +class GalleryApplicationUpdate(UpdateResourceDefinition): + """Specifies information about the gallery Application Definition that you want to update. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param tags: A set of tags. Resource tags. + :type tags: dict[str, str] + :param description: The description of this gallery Application Definition resource. This + property is updatable. + :type description: str + :param eula: The Eula agreement for the gallery Application Definition. + :type eula: str + :param privacy_statement_uri: The privacy statement uri. + :type privacy_statement_uri: str + :param release_note_uri: The release note uri. + :type release_note_uri: str + :param end_of_life_date: The end of life date of the gallery Application Definition. This + property can be used for decommissioning purposes. This property is updatable. + :type end_of_life_date: ~datetime.datetime + :param supported_os_type: This property allows you to specify the supported type of the OS that + application is built for. :code:`
`:code:`
` Possible values are: + :code:`
`:code:`
` **Windows** :code:`
`:code:`
` **Linux**. Possible values + include: "Windows", "Linux". + :type supported_os_type: str or ~azure.mgmt.compute.v2020_09_30.models.OperatingSystemTypes + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + 'eula': {'key': 'properties.eula', 'type': 'str'}, + 'privacy_statement_uri': {'key': 'properties.privacyStatementUri', 'type': 'str'}, + 'release_note_uri': {'key': 'properties.releaseNoteUri', 'type': 'str'}, + 'end_of_life_date': {'key': 'properties.endOfLifeDate', 'type': 'iso-8601'}, + 'supported_os_type': {'key': 'properties.supportedOSType', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(GalleryApplicationUpdate, self).__init__(**kwargs) + self.description = kwargs.get('description', None) + self.eula = kwargs.get('eula', None) + self.privacy_statement_uri = kwargs.get('privacy_statement_uri', None) + self.release_note_uri = kwargs.get('release_note_uri', None) + self.end_of_life_date = kwargs.get('end_of_life_date', None) + self.supported_os_type = kwargs.get('supported_os_type', None) + + +class GalleryApplicationVersion(Resource): + """Specifies information about the gallery Application Version that you want to create or update. + + 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: Resource Id. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param location: Required. Resource location. + :type location: str + :param tags: A set of tags. Resource tags. + :type tags: dict[str, str] + :param publishing_profile: The publishing profile of a gallery image version. + :type publishing_profile: + ~azure.mgmt.compute.v2020_09_30.models.GalleryApplicationVersionPublishingProfile + :ivar provisioning_state: The provisioning state, which only appears in the response. Possible + values include: "Creating", "Updating", "Failed", "Succeeded", "Deleting", "Migrating". + :vartype provisioning_state: str or + ~azure.mgmt.compute.v2020_09_30.models.GalleryApplicationVersionPropertiesProvisioningState + :ivar replication_status: This is the replication status of the gallery image version. + :vartype replication_status: ~azure.mgmt.compute.v2020_09_30.models.ReplicationStatus + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': True}, + 'provisioning_state': {'readonly': True}, + 'replication_status': {'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}'}, + 'publishing_profile': {'key': 'properties.publishingProfile', 'type': 'GalleryApplicationVersionPublishingProfile'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'replication_status': {'key': 'properties.replicationStatus', 'type': 'ReplicationStatus'}, + } + + def __init__( + self, + **kwargs + ): + super(GalleryApplicationVersion, self).__init__(**kwargs) + self.publishing_profile = kwargs.get('publishing_profile', None) + self.provisioning_state = None + self.replication_status = None + + +class GalleryApplicationVersionList(msrest.serialization.Model): + """The List Gallery Application version operation response. + + All required parameters must be populated in order to send to Azure. + + :param value: Required. A list of gallery Application Versions. + :type value: list[~azure.mgmt.compute.v2020_09_30.models.GalleryApplicationVersion] + :param next_link: The uri to fetch the next page of gallery Application Versions. Call + ListNext() with this to fetch the next page of gallery Application Versions. + :type next_link: str + """ + + _validation = { + 'value': {'required': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[GalleryApplicationVersion]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(GalleryApplicationVersionList, self).__init__(**kwargs) + self.value = kwargs['value'] + self.next_link = kwargs.get('next_link', None) + + +class GalleryArtifactPublishingProfileBase(msrest.serialization.Model): + """Describes the basic gallery artifact publishing profile. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param target_regions: The target regions where the Image Version is going to be replicated to. + This property is updatable. + :type target_regions: list[~azure.mgmt.compute.v2020_09_30.models.TargetRegion] + :param replica_count: The number of replicas of the Image Version to be created per region. + This property would take effect for a region when regionalReplicaCount is not specified. This + property is updatable. + :type replica_count: int + :param exclude_from_latest: If set to true, Virtual Machines deployed from the latest version + of the Image Definition won't use this Image Version. + :type exclude_from_latest: bool + :ivar published_date: The timestamp for when the gallery image version is published. + :vartype published_date: ~datetime.datetime + :param end_of_life_date: The end of life date of the gallery image version. This property can + be used for decommissioning purposes. This property is updatable. + :type end_of_life_date: ~datetime.datetime + :param storage_account_type: Specifies the storage account type to be used to store the image. + This property is not updatable. Possible values include: "Standard_LRS", "Standard_ZRS", + "Premium_LRS". + :type storage_account_type: str or ~azure.mgmt.compute.v2020_09_30.models.StorageAccountType + """ + + _validation = { + 'published_date': {'readonly': True}, + } + + _attribute_map = { + 'target_regions': {'key': 'targetRegions', 'type': '[TargetRegion]'}, + 'replica_count': {'key': 'replicaCount', 'type': 'int'}, + 'exclude_from_latest': {'key': 'excludeFromLatest', 'type': 'bool'}, + 'published_date': {'key': 'publishedDate', 'type': 'iso-8601'}, + 'end_of_life_date': {'key': 'endOfLifeDate', 'type': 'iso-8601'}, + 'storage_account_type': {'key': 'storageAccountType', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(GalleryArtifactPublishingProfileBase, self).__init__(**kwargs) + self.target_regions = kwargs.get('target_regions', None) + self.replica_count = kwargs.get('replica_count', None) + self.exclude_from_latest = kwargs.get('exclude_from_latest', None) + self.published_date = None + self.end_of_life_date = kwargs.get('end_of_life_date', None) + self.storage_account_type = kwargs.get('storage_account_type', None) + + +class GalleryApplicationVersionPublishingProfile(GalleryArtifactPublishingProfileBase): + """The publishing profile of a gallery image version. + + 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. + + :param target_regions: The target regions where the Image Version is going to be replicated to. + This property is updatable. + :type target_regions: list[~azure.mgmt.compute.v2020_09_30.models.TargetRegion] + :param replica_count: The number of replicas of the Image Version to be created per region. + This property would take effect for a region when regionalReplicaCount is not specified. This + property is updatable. + :type replica_count: int + :param exclude_from_latest: If set to true, Virtual Machines deployed from the latest version + of the Image Definition won't use this Image Version. + :type exclude_from_latest: bool + :ivar published_date: The timestamp for when the gallery image version is published. + :vartype published_date: ~datetime.datetime + :param end_of_life_date: The end of life date of the gallery image version. This property can + be used for decommissioning purposes. This property is updatable. + :type end_of_life_date: ~datetime.datetime + :param storage_account_type: Specifies the storage account type to be used to store the image. + This property is not updatable. Possible values include: "Standard_LRS", "Standard_ZRS", + "Premium_LRS". + :type storage_account_type: str or ~azure.mgmt.compute.v2020_09_30.models.StorageAccountType + :param source: Required. The source image from which the Image Version is going to be created. + :type source: ~azure.mgmt.compute.v2020_09_30.models.UserArtifactSource + :param manage_actions: + :type manage_actions: ~azure.mgmt.compute.v2020_09_30.models.UserArtifactManage + :param enable_health_check: Optional. Whether or not this application reports health. + :type enable_health_check: bool + """ + + _validation = { + 'published_date': {'readonly': True}, + 'source': {'required': True}, + } + + _attribute_map = { + 'target_regions': {'key': 'targetRegions', 'type': '[TargetRegion]'}, + 'replica_count': {'key': 'replicaCount', 'type': 'int'}, + 'exclude_from_latest': {'key': 'excludeFromLatest', 'type': 'bool'}, + 'published_date': {'key': 'publishedDate', 'type': 'iso-8601'}, + 'end_of_life_date': {'key': 'endOfLifeDate', 'type': 'iso-8601'}, + 'storage_account_type': {'key': 'storageAccountType', 'type': 'str'}, + 'source': {'key': 'source', 'type': 'UserArtifactSource'}, + 'manage_actions': {'key': 'manageActions', 'type': 'UserArtifactManage'}, + 'enable_health_check': {'key': 'enableHealthCheck', 'type': 'bool'}, + } + + def __init__( + self, + **kwargs + ): + super(GalleryApplicationVersionPublishingProfile, self).__init__(**kwargs) + self.source = kwargs['source'] + self.manage_actions = kwargs.get('manage_actions', None) + self.enable_health_check = kwargs.get('enable_health_check', None) + + +class GalleryApplicationVersionUpdate(UpdateResourceDefinition): + """Specifies information about the gallery Application Version that you want to update. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param tags: A set of tags. Resource tags. + :type tags: dict[str, str] + :param publishing_profile: The publishing profile of a gallery image version. + :type publishing_profile: + ~azure.mgmt.compute.v2020_09_30.models.GalleryApplicationVersionPublishingProfile + :ivar provisioning_state: The provisioning state, which only appears in the response. Possible + values include: "Creating", "Updating", "Failed", "Succeeded", "Deleting", "Migrating". + :vartype provisioning_state: str or + ~azure.mgmt.compute.v2020_09_30.models.GalleryApplicationVersionPropertiesProvisioningState + :ivar replication_status: This is the replication status of the gallery image version. + :vartype replication_status: ~azure.mgmt.compute.v2020_09_30.models.ReplicationStatus + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + 'replication_status': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'publishing_profile': {'key': 'properties.publishingProfile', 'type': 'GalleryApplicationVersionPublishingProfile'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'replication_status': {'key': 'properties.replicationStatus', 'type': 'ReplicationStatus'}, + } + + def __init__( + self, + **kwargs + ): + super(GalleryApplicationVersionUpdate, self).__init__(**kwargs) + self.publishing_profile = kwargs.get('publishing_profile', None) + self.provisioning_state = None + self.replication_status = None + + +class GalleryArtifactSource(msrest.serialization.Model): + """The source image from which the Image Version is going to be created. + + All required parameters must be populated in order to send to Azure. + + :param managed_image: Required. The managed artifact. + :type managed_image: ~azure.mgmt.compute.v2020_09_30.models.ManagedArtifact + """ + + _validation = { + 'managed_image': {'required': True}, + } + + _attribute_map = { + 'managed_image': {'key': 'managedImage', 'type': 'ManagedArtifact'}, + } + + def __init__( + self, + **kwargs + ): + super(GalleryArtifactSource, self).__init__(**kwargs) + self.managed_image = kwargs['managed_image'] + + +class GalleryArtifactVersionSource(msrest.serialization.Model): + """The gallery artifact version source. + + :param id: The id of the gallery artifact version source. Can specify a disk uri, snapshot uri, + user image or storage account resource. + :type id: str + :param uri: The uri of the gallery artifact version source. Currently used to specify vhd/blob + source. + :type uri: str + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'uri': {'key': 'uri', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(GalleryArtifactVersionSource, self).__init__(**kwargs) + self.id = kwargs.get('id', None) + self.uri = kwargs.get('uri', None) + + +class GalleryDiskImage(msrest.serialization.Model): + """This is the disk image base class. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar size_in_gb: This property indicates the size of the VHD to be created. + :vartype size_in_gb: int + :param host_caching: The host caching of the disk. Valid values are 'None', 'ReadOnly', and + 'ReadWrite'. Possible values include: "None", "ReadOnly", "ReadWrite". + :type host_caching: str or ~azure.mgmt.compute.v2020_09_30.models.HostCaching + :param source: The gallery artifact version source. + :type source: ~azure.mgmt.compute.v2020_09_30.models.GalleryArtifactVersionSource + """ + + _validation = { + 'size_in_gb': {'readonly': True}, + } + + _attribute_map = { + 'size_in_gb': {'key': 'sizeInGB', 'type': 'int'}, + 'host_caching': {'key': 'hostCaching', 'type': 'str'}, + 'source': {'key': 'source', 'type': 'GalleryArtifactVersionSource'}, + } + + def __init__( + self, + **kwargs + ): + super(GalleryDiskImage, self).__init__(**kwargs) + self.size_in_gb = None + self.host_caching = kwargs.get('host_caching', None) + self.source = kwargs.get('source', None) + + +class GalleryDataDiskImage(GalleryDiskImage): + """This is the data disk image. + + 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 size_in_gb: This property indicates the size of the VHD to be created. + :vartype size_in_gb: int + :param host_caching: The host caching of the disk. Valid values are 'None', 'ReadOnly', and + 'ReadWrite'. Possible values include: "None", "ReadOnly", "ReadWrite". + :type host_caching: str or ~azure.mgmt.compute.v2020_09_30.models.HostCaching + :param source: The gallery artifact version source. + :type source: ~azure.mgmt.compute.v2020_09_30.models.GalleryArtifactVersionSource + :param lun: Required. This property specifies the logical unit number of the data disk. This + value is used to identify data disks within the Virtual Machine and therefore must be unique + for each data disk attached to the Virtual Machine. + :type lun: int + """ + + _validation = { + 'size_in_gb': {'readonly': True}, + 'lun': {'required': True}, + } + + _attribute_map = { + 'size_in_gb': {'key': 'sizeInGB', 'type': 'int'}, + 'host_caching': {'key': 'hostCaching', 'type': 'str'}, + 'source': {'key': 'source', 'type': 'GalleryArtifactVersionSource'}, + 'lun': {'key': 'lun', 'type': 'int'}, + } + + def __init__( + self, + **kwargs + ): + super(GalleryDataDiskImage, self).__init__(**kwargs) + self.lun = kwargs['lun'] + + +class GalleryIdentifier(msrest.serialization.Model): + """Describes the gallery unique name. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar unique_name: The unique name of the Shared Image Gallery. This name is generated + automatically by Azure. + :vartype unique_name: str + """ + + _validation = { + 'unique_name': {'readonly': True}, + } + + _attribute_map = { + 'unique_name': {'key': 'uniqueName', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(GalleryIdentifier, self).__init__(**kwargs) + self.unique_name = None + + +class GalleryImage(Resource): + """Specifies information about the gallery image definition that you want to create or update. + + 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: Resource Id. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param location: Required. Resource location. + :type location: str + :param tags: A set of tags. Resource tags. + :type tags: dict[str, str] + :param description: The description of this gallery image definition resource. This property is + updatable. + :type description: str + :param eula: The Eula agreement for the gallery image definition. + :type eula: str + :param privacy_statement_uri: The privacy statement uri. + :type privacy_statement_uri: str + :param release_note_uri: The release note uri. + :type release_note_uri: str + :param os_type: This property allows you to specify the type of the OS that is included in the + disk when creating a VM from a managed image. :code:`
`:code:`
` Possible values are: + :code:`
`:code:`
` **Windows** :code:`
`:code:`
` **Linux**. Possible values + include: "Windows", "Linux". + :type os_type: str or ~azure.mgmt.compute.v2020_09_30.models.OperatingSystemTypes + :param os_state: This property allows the user to specify whether the virtual machines created + under this image are 'Generalized' or 'Specialized'. Possible values include: "Generalized", + "Specialized". + :type os_state: str or ~azure.mgmt.compute.v2020_09_30.models.OperatingSystemStateTypes + :param hyper_v_generation: The hypervisor generation of the Virtual Machine. Applicable to OS + disks only. Possible values include: "V1", "V2". + :type hyper_v_generation: str or ~azure.mgmt.compute.v2020_09_30.models.HyperVGeneration + :param features: A list of gallery image features. + :type features: list[~azure.mgmt.compute.v2020_09_30.models.GalleryImageFeature] + :param end_of_life_date: The end of life date of the gallery image definition. This property + can be used for decommissioning purposes. This property is updatable. + :type end_of_life_date: ~datetime.datetime + :param identifier: This is the gallery image definition identifier. + :type identifier: ~azure.mgmt.compute.v2020_09_30.models.GalleryImageIdentifier + :param recommended: The properties describe the recommended machine configuration for this + Image Definition. These properties are updatable. + :type recommended: ~azure.mgmt.compute.v2020_09_30.models.RecommendedMachineConfiguration + :param disallowed: Describes the disallowed disk types. + :type disallowed: ~azure.mgmt.compute.v2020_09_30.models.Disallowed + :param purchase_plan: Describes the gallery image definition purchase plan. This is used by + marketplace images. + :type purchase_plan: ~azure.mgmt.compute.v2020_09_30.models.ImagePurchasePlan + :ivar provisioning_state: The provisioning state, which only appears in the response. Possible + values include: "Creating", "Updating", "Failed", "Succeeded", "Deleting", "Migrating". + :vartype provisioning_state: str or + ~azure.mgmt.compute.v2020_09_30.models.GalleryImagePropertiesProvisioningState + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': True}, + 'provisioning_state': {'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}'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + 'eula': {'key': 'properties.eula', 'type': 'str'}, + 'privacy_statement_uri': {'key': 'properties.privacyStatementUri', 'type': 'str'}, + 'release_note_uri': {'key': 'properties.releaseNoteUri', 'type': 'str'}, + 'os_type': {'key': 'properties.osType', 'type': 'str'}, + 'os_state': {'key': 'properties.osState', 'type': 'str'}, + 'hyper_v_generation': {'key': 'properties.hyperVGeneration', 'type': 'str'}, + 'features': {'key': 'properties.features', 'type': '[GalleryImageFeature]'}, + 'end_of_life_date': {'key': 'properties.endOfLifeDate', 'type': 'iso-8601'}, + 'identifier': {'key': 'properties.identifier', 'type': 'GalleryImageIdentifier'}, + 'recommended': {'key': 'properties.recommended', 'type': 'RecommendedMachineConfiguration'}, + 'disallowed': {'key': 'properties.disallowed', 'type': 'Disallowed'}, + 'purchase_plan': {'key': 'properties.purchasePlan', 'type': 'ImagePurchasePlan'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(GalleryImage, self).__init__(**kwargs) + self.description = kwargs.get('description', None) + self.eula = kwargs.get('eula', None) + self.privacy_statement_uri = kwargs.get('privacy_statement_uri', None) + self.release_note_uri = kwargs.get('release_note_uri', None) + self.os_type = kwargs.get('os_type', None) + self.os_state = kwargs.get('os_state', None) + self.hyper_v_generation = kwargs.get('hyper_v_generation', None) + self.features = kwargs.get('features', None) + self.end_of_life_date = kwargs.get('end_of_life_date', None) + self.identifier = kwargs.get('identifier', None) + self.recommended = kwargs.get('recommended', None) + self.disallowed = kwargs.get('disallowed', None) + self.purchase_plan = kwargs.get('purchase_plan', None) + self.provisioning_state = None + + +class GalleryImageFeature(msrest.serialization.Model): + """A feature for gallery image. + + :param name: The name of the gallery image feature. + :type name: str + :param value: The value of the gallery image feature. + :type value: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'value': {'key': 'value', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(GalleryImageFeature, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.value = kwargs.get('value', None) + + +class GalleryImageIdentifier(msrest.serialization.Model): + """This is the gallery image definition identifier. + + All required parameters must be populated in order to send to Azure. + + :param publisher: Required. The name of the gallery image definition publisher. + :type publisher: str + :param offer: Required. The name of the gallery image definition offer. + :type offer: str + :param sku: Required. The name of the gallery image definition SKU. + :type sku: str + """ + + _validation = { + 'publisher': {'required': True}, + 'offer': {'required': True}, + 'sku': {'required': True}, + } + + _attribute_map = { + 'publisher': {'key': 'publisher', 'type': 'str'}, + 'offer': {'key': 'offer', 'type': 'str'}, + 'sku': {'key': 'sku', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(GalleryImageIdentifier, self).__init__(**kwargs) + self.publisher = kwargs['publisher'] + self.offer = kwargs['offer'] + self.sku = kwargs['sku'] + + +class GalleryImageList(msrest.serialization.Model): + """The List Gallery Images operation response. + + All required parameters must be populated in order to send to Azure. + + :param value: Required. A list of Shared Image Gallery images. + :type value: list[~azure.mgmt.compute.v2020_09_30.models.GalleryImage] + :param next_link: The uri to fetch the next page of Image Definitions in the Shared Image + Gallery. Call ListNext() with this to fetch the next page of gallery image definitions. + :type next_link: str + """ + + _validation = { + 'value': {'required': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[GalleryImage]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(GalleryImageList, self).__init__(**kwargs) + self.value = kwargs['value'] + self.next_link = kwargs.get('next_link', None) + + +class GalleryImageUpdate(UpdateResourceDefinition): + """Specifies information about the gallery image definition that you want to update. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param tags: A set of tags. Resource tags. + :type tags: dict[str, str] + :param description: The description of this gallery image definition resource. This property is + updatable. + :type description: str + :param eula: The Eula agreement for the gallery image definition. + :type eula: str + :param privacy_statement_uri: The privacy statement uri. + :type privacy_statement_uri: str + :param release_note_uri: The release note uri. + :type release_note_uri: str + :param os_type: This property allows you to specify the type of the OS that is included in the + disk when creating a VM from a managed image. :code:`
`:code:`
` Possible values are: + :code:`
`:code:`
` **Windows** :code:`
`:code:`
` **Linux**. Possible values + include: "Windows", "Linux". + :type os_type: str or ~azure.mgmt.compute.v2020_09_30.models.OperatingSystemTypes + :param os_state: This property allows the user to specify whether the virtual machines created + under this image are 'Generalized' or 'Specialized'. Possible values include: "Generalized", + "Specialized". + :type os_state: str or ~azure.mgmt.compute.v2020_09_30.models.OperatingSystemStateTypes + :param hyper_v_generation: The hypervisor generation of the Virtual Machine. Applicable to OS + disks only. Possible values include: "V1", "V2". + :type hyper_v_generation: str or ~azure.mgmt.compute.v2020_09_30.models.HyperVGeneration + :param features: A list of gallery image features. + :type features: list[~azure.mgmt.compute.v2020_09_30.models.GalleryImageFeature] + :param end_of_life_date: The end of life date of the gallery image definition. This property + can be used for decommissioning purposes. This property is updatable. + :type end_of_life_date: ~datetime.datetime + :param identifier: This is the gallery image definition identifier. + :type identifier: ~azure.mgmt.compute.v2020_09_30.models.GalleryImageIdentifier + :param recommended: The properties describe the recommended machine configuration for this + Image Definition. These properties are updatable. + :type recommended: ~azure.mgmt.compute.v2020_09_30.models.RecommendedMachineConfiguration + :param disallowed: Describes the disallowed disk types. + :type disallowed: ~azure.mgmt.compute.v2020_09_30.models.Disallowed + :param purchase_plan: Describes the gallery image definition purchase plan. This is used by + marketplace images. + :type purchase_plan: ~azure.mgmt.compute.v2020_09_30.models.ImagePurchasePlan + :ivar provisioning_state: The provisioning state, which only appears in the response. Possible + values include: "Creating", "Updating", "Failed", "Succeeded", "Deleting", "Migrating". + :vartype provisioning_state: str or + ~azure.mgmt.compute.v2020_09_30.models.GalleryImagePropertiesProvisioningState + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + 'eula': {'key': 'properties.eula', 'type': 'str'}, + 'privacy_statement_uri': {'key': 'properties.privacyStatementUri', 'type': 'str'}, + 'release_note_uri': {'key': 'properties.releaseNoteUri', 'type': 'str'}, + 'os_type': {'key': 'properties.osType', 'type': 'str'}, + 'os_state': {'key': 'properties.osState', 'type': 'str'}, + 'hyper_v_generation': {'key': 'properties.hyperVGeneration', 'type': 'str'}, + 'features': {'key': 'properties.features', 'type': '[GalleryImageFeature]'}, + 'end_of_life_date': {'key': 'properties.endOfLifeDate', 'type': 'iso-8601'}, + 'identifier': {'key': 'properties.identifier', 'type': 'GalleryImageIdentifier'}, + 'recommended': {'key': 'properties.recommended', 'type': 'RecommendedMachineConfiguration'}, + 'disallowed': {'key': 'properties.disallowed', 'type': 'Disallowed'}, + 'purchase_plan': {'key': 'properties.purchasePlan', 'type': 'ImagePurchasePlan'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(GalleryImageUpdate, self).__init__(**kwargs) + self.description = kwargs.get('description', None) + self.eula = kwargs.get('eula', None) + self.privacy_statement_uri = kwargs.get('privacy_statement_uri', None) + self.release_note_uri = kwargs.get('release_note_uri', None) + self.os_type = kwargs.get('os_type', None) + self.os_state = kwargs.get('os_state', None) + self.hyper_v_generation = kwargs.get('hyper_v_generation', None) + self.features = kwargs.get('features', None) + self.end_of_life_date = kwargs.get('end_of_life_date', None) + self.identifier = kwargs.get('identifier', None) + self.recommended = kwargs.get('recommended', None) + self.disallowed = kwargs.get('disallowed', None) + self.purchase_plan = kwargs.get('purchase_plan', None) + self.provisioning_state = None + + +class GalleryImageVersion(Resource): + """Specifies information about the gallery image version that you want to create or update. + + 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: Resource Id. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param location: Required. Resource location. + :type location: str + :param tags: A set of tags. Resource tags. + :type tags: dict[str, str] + :param publishing_profile: Describes the basic gallery artifact publishing profile. + :type publishing_profile: + ~azure.mgmt.compute.v2020_09_30.models.GalleryArtifactPublishingProfileBase + :ivar provisioning_state: The provisioning state, which only appears in the response. Possible + values include: "Creating", "Updating", "Failed", "Succeeded", "Deleting", "Migrating". + :vartype provisioning_state: str or + ~azure.mgmt.compute.v2020_09_30.models.GalleryImageVersionPropertiesProvisioningState + :param storage_profile: This is the storage profile of a Gallery Image Version. + :type storage_profile: ~azure.mgmt.compute.v2020_09_30.models.GalleryImageVersionStorageProfile + :ivar replication_status: This is the replication status of the gallery image version. + :vartype replication_status: ~azure.mgmt.compute.v2020_09_30.models.ReplicationStatus + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': True}, + 'provisioning_state': {'readonly': True}, + 'replication_status': {'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}'}, + 'publishing_profile': {'key': 'properties.publishingProfile', 'type': 'GalleryArtifactPublishingProfileBase'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'storage_profile': {'key': 'properties.storageProfile', 'type': 'GalleryImageVersionStorageProfile'}, + 'replication_status': {'key': 'properties.replicationStatus', 'type': 'ReplicationStatus'}, + } + + def __init__( + self, + **kwargs + ): + super(GalleryImageVersion, self).__init__(**kwargs) + self.publishing_profile = kwargs.get('publishing_profile', None) + self.provisioning_state = None + self.storage_profile = kwargs.get('storage_profile', None) + self.replication_status = None + + +class GalleryImageVersionList(msrest.serialization.Model): + """The List Gallery Image version operation response. + + All required parameters must be populated in order to send to Azure. + + :param value: Required. A list of gallery image versions. + :type value: list[~azure.mgmt.compute.v2020_09_30.models.GalleryImageVersion] + :param next_link: The uri to fetch the next page of gallery image versions. Call ListNext() + with this to fetch the next page of gallery image versions. + :type next_link: str + """ + + _validation = { + 'value': {'required': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[GalleryImageVersion]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(GalleryImageVersionList, self).__init__(**kwargs) + self.value = kwargs['value'] + self.next_link = kwargs.get('next_link', None) + + +class GalleryImageVersionPublishingProfile(GalleryArtifactPublishingProfileBase): + """The publishing profile of a gallery image Version. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param target_regions: The target regions where the Image Version is going to be replicated to. + This property is updatable. + :type target_regions: list[~azure.mgmt.compute.v2020_09_30.models.TargetRegion] + :param replica_count: The number of replicas of the Image Version to be created per region. + This property would take effect for a region when regionalReplicaCount is not specified. This + property is updatable. + :type replica_count: int + :param exclude_from_latest: If set to true, Virtual Machines deployed from the latest version + of the Image Definition won't use this Image Version. + :type exclude_from_latest: bool + :ivar published_date: The timestamp for when the gallery image version is published. + :vartype published_date: ~datetime.datetime + :param end_of_life_date: The end of life date of the gallery image version. This property can + be used for decommissioning purposes. This property is updatable. + :type end_of_life_date: ~datetime.datetime + :param storage_account_type: Specifies the storage account type to be used to store the image. + This property is not updatable. Possible values include: "Standard_LRS", "Standard_ZRS", + "Premium_LRS". + :type storage_account_type: str or ~azure.mgmt.compute.v2020_09_30.models.StorageAccountType + """ + + _validation = { + 'published_date': {'readonly': True}, + } + + _attribute_map = { + 'target_regions': {'key': 'targetRegions', 'type': '[TargetRegion]'}, + 'replica_count': {'key': 'replicaCount', 'type': 'int'}, + 'exclude_from_latest': {'key': 'excludeFromLatest', 'type': 'bool'}, + 'published_date': {'key': 'publishedDate', 'type': 'iso-8601'}, + 'end_of_life_date': {'key': 'endOfLifeDate', 'type': 'iso-8601'}, + 'storage_account_type': {'key': 'storageAccountType', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(GalleryImageVersionPublishingProfile, self).__init__(**kwargs) + + +class GalleryImageVersionStorageProfile(msrest.serialization.Model): + """This is the storage profile of a Gallery Image Version. + + :param source: The gallery artifact version source. + :type source: ~azure.mgmt.compute.v2020_09_30.models.GalleryArtifactVersionSource + :param os_disk_image: This is the disk image base class. + :type os_disk_image: ~azure.mgmt.compute.v2020_09_30.models.GalleryDiskImage + :param data_disk_images: A list of data disk images. + :type data_disk_images: list[~azure.mgmt.compute.v2020_09_30.models.GalleryDataDiskImage] + """ + + _attribute_map = { + 'source': {'key': 'source', 'type': 'GalleryArtifactVersionSource'}, + 'os_disk_image': {'key': 'osDiskImage', 'type': 'GalleryDiskImage'}, + 'data_disk_images': {'key': 'dataDiskImages', 'type': '[GalleryDataDiskImage]'}, + } + + def __init__( + self, + **kwargs + ): + super(GalleryImageVersionStorageProfile, self).__init__(**kwargs) + self.source = kwargs.get('source', None) + self.os_disk_image = kwargs.get('os_disk_image', None) + self.data_disk_images = kwargs.get('data_disk_images', None) + + +class GalleryImageVersionUpdate(UpdateResourceDefinition): + """Specifies information about the gallery image version that you want to update. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param tags: A set of tags. Resource tags. + :type tags: dict[str, str] + :param publishing_profile: Describes the basic gallery artifact publishing profile. + :type publishing_profile: + ~azure.mgmt.compute.v2020_09_30.models.GalleryArtifactPublishingProfileBase + :ivar provisioning_state: The provisioning state, which only appears in the response. Possible + values include: "Creating", "Updating", "Failed", "Succeeded", "Deleting", "Migrating". + :vartype provisioning_state: str or + ~azure.mgmt.compute.v2020_09_30.models.GalleryImageVersionPropertiesProvisioningState + :param storage_profile: This is the storage profile of a Gallery Image Version. + :type storage_profile: ~azure.mgmt.compute.v2020_09_30.models.GalleryImageVersionStorageProfile + :ivar replication_status: This is the replication status of the gallery image version. + :vartype replication_status: ~azure.mgmt.compute.v2020_09_30.models.ReplicationStatus + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + 'replication_status': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'publishing_profile': {'key': 'properties.publishingProfile', 'type': 'GalleryArtifactPublishingProfileBase'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'storage_profile': {'key': 'properties.storageProfile', 'type': 'GalleryImageVersionStorageProfile'}, + 'replication_status': {'key': 'properties.replicationStatus', 'type': 'ReplicationStatus'}, + } + + def __init__( + self, + **kwargs + ): + super(GalleryImageVersionUpdate, self).__init__(**kwargs) + self.publishing_profile = kwargs.get('publishing_profile', None) + self.provisioning_state = None + self.storage_profile = kwargs.get('storage_profile', None) + self.replication_status = None + + +class GalleryList(msrest.serialization.Model): + """The List Galleries operation response. + + All required parameters must be populated in order to send to Azure. + + :param value: Required. A list of galleries. + :type value: list[~azure.mgmt.compute.v2020_09_30.models.Gallery] + :param next_link: The uri to fetch the next page of galleries. Call ListNext() with this to + fetch the next page of galleries. + :type next_link: str + """ + + _validation = { + 'value': {'required': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[Gallery]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(GalleryList, self).__init__(**kwargs) + self.value = kwargs['value'] + self.next_link = kwargs.get('next_link', None) + + +class GalleryOSDiskImage(GalleryDiskImage): + """This is the OS disk image. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar size_in_gb: This property indicates the size of the VHD to be created. + :vartype size_in_gb: int + :param host_caching: The host caching of the disk. Valid values are 'None', 'ReadOnly', and + 'ReadWrite'. Possible values include: "None", "ReadOnly", "ReadWrite". + :type host_caching: str or ~azure.mgmt.compute.v2020_09_30.models.HostCaching + :param source: The gallery artifact version source. + :type source: ~azure.mgmt.compute.v2020_09_30.models.GalleryArtifactVersionSource + """ + + _validation = { + 'size_in_gb': {'readonly': True}, + } + + _attribute_map = { + 'size_in_gb': {'key': 'sizeInGB', 'type': 'int'}, + 'host_caching': {'key': 'hostCaching', 'type': 'str'}, + 'source': {'key': 'source', 'type': 'GalleryArtifactVersionSource'}, + } + + def __init__( + self, + **kwargs + ): + super(GalleryOSDiskImage, self).__init__(**kwargs) + + +class GalleryUpdate(UpdateResourceDefinition): + """Specifies information about the Shared Image Gallery that you want to update. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param tags: A set of tags. Resource tags. + :type tags: dict[str, str] + :param description: The description of this Shared Image Gallery resource. This property is + updatable. + :type description: str + :param identifier: Describes the gallery unique name. + :type identifier: ~azure.mgmt.compute.v2020_09_30.models.GalleryIdentifier + :ivar provisioning_state: The provisioning state, which only appears in the response. Possible + values include: "Creating", "Updating", "Failed", "Succeeded", "Deleting", "Migrating". + :vartype provisioning_state: str or + ~azure.mgmt.compute.v2020_09_30.models.GalleryPropertiesProvisioningState + :param sharing_profile: Profile for gallery sharing to subscription or tenant. + :type sharing_profile: ~azure.mgmt.compute.v2020_09_30.models.SharingProfile + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + 'identifier': {'key': 'properties.identifier', 'type': 'GalleryIdentifier'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'sharing_profile': {'key': 'properties.sharingProfile', 'type': 'SharingProfile'}, + } + + def __init__( + self, + **kwargs + ): + super(GalleryUpdate, self).__init__(**kwargs) + self.description = kwargs.get('description', None) + self.identifier = kwargs.get('identifier', None) + self.provisioning_state = None + self.sharing_profile = kwargs.get('sharing_profile', None) + + +class GrantAccessData(msrest.serialization.Model): + """Data used for requesting a SAS. + + All required parameters must be populated in order to send to Azure. + + :param access: Required. Possible values include: "None", "Read", "Write". + :type access: str or ~azure.mgmt.compute.v2020_09_30.models.AccessLevel + :param duration_in_seconds: Required. Time duration in seconds until the SAS access expires. + :type duration_in_seconds: int + """ + + _validation = { + 'access': {'required': True}, + 'duration_in_seconds': {'required': True}, + } + + _attribute_map = { + 'access': {'key': 'access', 'type': 'str'}, + 'duration_in_seconds': {'key': 'durationInSeconds', 'type': 'int'}, + } + + def __init__( + self, + **kwargs + ): + super(GrantAccessData, self).__init__(**kwargs) + self.access = kwargs['access'] + self.duration_in_seconds = kwargs['duration_in_seconds'] + + +class ImageDiskReference(msrest.serialization.Model): + """The source image used for creating the disk. + + All required parameters must be populated in order to send to Azure. + + :param id: Required. A relative uri containing either a Platform Image Repository or user image + reference. + :type id: str + :param lun: If the disk is created from an image's data disk, this is an index that indicates + which of the data disks in the image to use. For OS disks, this field is null. + :type lun: int + """ + + _validation = { + 'id': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'lun': {'key': 'lun', 'type': 'int'}, + } + + def __init__( + self, + **kwargs + ): + super(ImageDiskReference, self).__init__(**kwargs) + self.id = kwargs['id'] + self.lun = kwargs.get('lun', None) + + +class ImagePurchasePlan(msrest.serialization.Model): + """Describes the gallery image definition purchase plan. This is used by marketplace images. + + :param name: The plan ID. + :type name: str + :param publisher: The publisher ID. + :type publisher: str + :param product: The product ID. + :type product: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'publisher': {'key': 'publisher', 'type': 'str'}, + 'product': {'key': 'product', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ImagePurchasePlan, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.publisher = kwargs.get('publisher', None) + self.product = kwargs.get('product', None) + + +class InnerError(msrest.serialization.Model): + """Inner error details. + + :param exceptiontype: The exception type. + :type exceptiontype: str + :param errordetail: The internal error message or exception dump. + :type errordetail: str + """ + + _attribute_map = { + 'exceptiontype': {'key': 'exceptiontype', 'type': 'str'}, + 'errordetail': {'key': 'errordetail', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(InnerError, self).__init__(**kwargs) + self.exceptiontype = kwargs.get('exceptiontype', None) + self.errordetail = kwargs.get('errordetail', None) + + +class KeyForDiskEncryptionSet(msrest.serialization.Model): + """Key Vault Key Url to be used for server side encryption of Managed Disks and Snapshots. + + All required parameters must be populated in order to send to Azure. + + :param source_vault: Resource id of the KeyVault containing the key or secret. This property is + optional and cannot be used if the KeyVault subscription is not the same as the Disk Encryption + Set subscription. + :type source_vault: ~azure.mgmt.compute.v2020_09_30.models.SourceVault + :param key_url: Required. Fully versioned Key Url pointing to a key in KeyVault. + :type key_url: str """ _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'location': {'required': True}, - 'provisioning_state': {'readonly': True}, - 'replication_status': {'readonly': True}, + 'key_url': {'required': 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}'}, - 'publishing_profile': {'key': 'properties.publishingProfile', 'type': 'GalleryArtifactPublishingProfileBase'}, - 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, - 'storage_profile': {'key': 'properties.storageProfile', 'type': 'GalleryImageVersionStorageProfile'}, - 'replication_status': {'key': 'properties.replicationStatus', 'type': 'ReplicationStatus'}, + 'source_vault': {'key': 'sourceVault', 'type': 'SourceVault'}, + 'key_url': {'key': 'keyUrl', 'type': 'str'}, } def __init__( self, **kwargs ): - super(GalleryImageVersion, self).__init__(**kwargs) - self.publishing_profile = kwargs.get('publishing_profile', None) - self.provisioning_state = None - self.storage_profile = kwargs.get('storage_profile', None) - self.replication_status = None + super(KeyForDiskEncryptionSet, self).__init__(**kwargs) + self.source_vault = kwargs.get('source_vault', None) + self.key_url = kwargs['key_url'] -class GalleryImageVersionList(msrest.serialization.Model): - """The List Gallery Image version operation response. +class KeyVaultAndKeyReference(msrest.serialization.Model): + """Key Vault Key Url and vault id of KeK, KeK is optional and when provided is used to unwrap the encryptionKey. All required parameters must be populated in order to send to Azure. - :param value: Required. A list of gallery image versions. - :type value: list[~azure.mgmt.compute.v2020_09_30.models.GalleryImageVersion] - :param next_link: The uri to fetch the next page of gallery image versions. Call ListNext() - with this to fetch the next page of gallery image versions. - :type next_link: str + :param source_vault: Required. Resource id of the KeyVault containing the key or secret. + :type source_vault: ~azure.mgmt.compute.v2020_09_30.models.SourceVault + :param key_url: Required. Url pointing to a key or secret in KeyVault. + :type key_url: str """ _validation = { - 'value': {'required': True}, + 'source_vault': {'required': True}, + 'key_url': {'required': True}, } _attribute_map = { - 'value': {'key': 'value', 'type': '[GalleryImageVersion]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'source_vault': {'key': 'sourceVault', 'type': 'SourceVault'}, + 'key_url': {'key': 'keyUrl', 'type': 'str'}, } def __init__( self, **kwargs ): - super(GalleryImageVersionList, self).__init__(**kwargs) - self.value = kwargs['value'] - self.next_link = kwargs.get('next_link', None) + super(KeyVaultAndKeyReference, self).__init__(**kwargs) + self.source_vault = kwargs['source_vault'] + self.key_url = kwargs['key_url'] -class GalleryImageVersionPublishingProfile(GalleryArtifactPublishingProfileBase): - """The publishing profile of a gallery image Version. +class KeyVaultAndSecretReference(msrest.serialization.Model): + """Key Vault Secret Url and vault id of the encryption key. - 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. - :param target_regions: The target regions where the Image Version is going to be replicated to. - This property is updatable. - :type target_regions: list[~azure.mgmt.compute.v2020_09_30.models.TargetRegion] - :param replica_count: The number of replicas of the Image Version to be created per region. - This property would take effect for a region when regionalReplicaCount is not specified. This - property is updatable. - :type replica_count: int - :param exclude_from_latest: If set to true, Virtual Machines deployed from the latest version - of the Image Definition won't use this Image Version. - :type exclude_from_latest: bool - :ivar published_date: The timestamp for when the gallery image version is published. - :vartype published_date: ~datetime.datetime - :param end_of_life_date: The end of life date of the gallery image version. This property can - be used for decommissioning purposes. This property is updatable. - :type end_of_life_date: ~datetime.datetime - :param storage_account_type: Specifies the storage account type to be used to store the image. - This property is not updatable. Possible values include: "Standard_LRS", "Standard_ZRS", - "Premium_LRS". - :type storage_account_type: str or ~azure.mgmt.compute.v2020_09_30.models.StorageAccountType + :param source_vault: Required. Resource id of the KeyVault containing the key or secret. + :type source_vault: ~azure.mgmt.compute.v2020_09_30.models.SourceVault + :param secret_url: Required. Url pointing to a key or secret in KeyVault. + :type secret_url: str """ _validation = { - 'published_date': {'readonly': True}, + 'source_vault': {'required': True}, + 'secret_url': {'required': True}, } _attribute_map = { - 'target_regions': {'key': 'targetRegions', 'type': '[TargetRegion]'}, - 'replica_count': {'key': 'replicaCount', 'type': 'int'}, - 'exclude_from_latest': {'key': 'excludeFromLatest', 'type': 'bool'}, - 'published_date': {'key': 'publishedDate', 'type': 'iso-8601'}, - 'end_of_life_date': {'key': 'endOfLifeDate', 'type': 'iso-8601'}, - 'storage_account_type': {'key': 'storageAccountType', 'type': 'str'}, + 'source_vault': {'key': 'sourceVault', 'type': 'SourceVault'}, + 'secret_url': {'key': 'secretUrl', 'type': 'str'}, } def __init__( self, **kwargs ): - super(GalleryImageVersionPublishingProfile, self).__init__(**kwargs) + super(KeyVaultAndSecretReference, self).__init__(**kwargs) + self.source_vault = kwargs['source_vault'] + self.secret_url = kwargs['secret_url'] -class GalleryImageVersionStorageProfile(msrest.serialization.Model): - """This is the storage profile of a Gallery Image Version. +class ManagedArtifact(msrest.serialization.Model): + """The managed artifact. - :param source: The gallery artifact version source. - :type source: ~azure.mgmt.compute.v2020_09_30.models.GalleryArtifactVersionSource - :param os_disk_image: This is the disk image base class. - :type os_disk_image: ~azure.mgmt.compute.v2020_09_30.models.GalleryDiskImage - :param data_disk_images: A list of data disk images. - :type data_disk_images: list[~azure.mgmt.compute.v2020_09_30.models.GalleryDataDiskImage] + All required parameters must be populated in order to send to Azure. + + :param id: Required. The managed artifact id. + :type id: str """ + _validation = { + 'id': {'required': True}, + } + _attribute_map = { - 'source': {'key': 'source', 'type': 'GalleryArtifactVersionSource'}, - 'os_disk_image': {'key': 'osDiskImage', 'type': 'GalleryDiskImage'}, - 'data_disk_images': {'key': 'dataDiskImages', 'type': '[GalleryDataDiskImage]'}, + 'id': {'key': 'id', 'type': 'str'}, } def __init__( self, **kwargs ): - super(GalleryImageVersionStorageProfile, self).__init__(**kwargs) - self.source = kwargs.get('source', None) - self.os_disk_image = kwargs.get('os_disk_image', None) - self.data_disk_images = kwargs.get('data_disk_images', None) + super(ManagedArtifact, self).__init__(**kwargs) + self.id = kwargs['id'] -class GalleryImageVersionUpdate(UpdateResourceDefinition): - """Specifies information about the gallery image version that you want to update. +class OSDiskImageEncryption(DiskImageEncryption): + """Contains encryption settings for an OS disk image. + + :param disk_encryption_set_id: A relative URI containing the resource ID of the disk encryption + set. + :type disk_encryption_set_id: str + """ + + _attribute_map = { + 'disk_encryption_set_id': {'key': 'diskEncryptionSetId', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(OSDiskImageEncryption, self).__init__(**kwargs) + + +class PirResource(msrest.serialization.Model): + """The Resource model definition. Variables are only populated by the server, and will be ignored when sending a request. - :ivar id: Resource Id. - :vartype id: str :ivar name: Resource name. :vartype name: str - :ivar type: Resource type. - :vartype type: str - :param tags: A set of tags. Resource tags. - :type tags: dict[str, str] - :param publishing_profile: Describes the basic gallery artifact publishing profile. - :type publishing_profile: - ~azure.mgmt.compute.v2020_09_30.models.GalleryArtifactPublishingProfileBase - :ivar provisioning_state: The provisioning state, which only appears in the response. Possible - values include: "Creating", "Updating", "Failed", "Succeeded", "Deleting", "Migrating". - :vartype provisioning_state: str or - ~azure.mgmt.compute.v2020_09_30.models.GalleryImageVersionPropertiesProvisioningState - :param storage_profile: This is the storage profile of a Gallery Image Version. - :type storage_profile: ~azure.mgmt.compute.v2020_09_30.models.GalleryImageVersionStorageProfile - :ivar replication_status: This is the replication status of the gallery image version. - :vartype replication_status: ~azure.mgmt.compute.v2020_09_30.models.ReplicationStatus + :ivar location: Resource location. + :vartype location: str """ _validation = { - 'id': {'readonly': True}, 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'provisioning_state': {'readonly': True}, - 'replication_status': {'readonly': True}, + 'location': {'readonly': True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'publishing_profile': {'key': 'properties.publishingProfile', 'type': 'GalleryArtifactPublishingProfileBase'}, - 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, - 'storage_profile': {'key': 'properties.storageProfile', 'type': 'GalleryImageVersionStorageProfile'}, - 'replication_status': {'key': 'properties.replicationStatus', 'type': 'ReplicationStatus'}, + 'location': {'key': 'location', 'type': 'str'}, } def __init__( self, **kwargs ): - super(GalleryImageVersionUpdate, self).__init__(**kwargs) - self.publishing_profile = kwargs.get('publishing_profile', None) - self.provisioning_state = None - self.storage_profile = kwargs.get('storage_profile', None) - self.replication_status = None + super(PirResource, self).__init__(**kwargs) + self.name = None + self.location = None -class GalleryList(msrest.serialization.Model): - """The List Galleries operation response. +class PirSharedGalleryResource(PirResource): + """Base information about the shared gallery resource in pir. - All required parameters must be populated in order to send to Azure. + Variables are only populated by the server, and will be ignored when sending a request. - :param value: Required. A list of galleries. - :type value: list[~azure.mgmt.compute.v2020_09_30.models.Gallery] - :param next_link: The uri to fetch the next page of galleries. Call ListNext() with this to - fetch the next page of galleries. - :type next_link: str + :ivar name: Resource name. + :vartype name: str + :ivar location: Resource location. + :vartype location: str + :param unique_id: The unique id of this shared gallery. + :type unique_id: str """ _validation = { - 'value': {'required': True}, + 'name': {'readonly': True}, + 'location': {'readonly': True}, } _attribute_map = { - 'value': {'key': 'value', 'type': '[Gallery]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'unique_id': {'key': 'identifier.uniqueId', 'type': 'str'}, } def __init__( self, **kwargs ): - super(GalleryList, self).__init__(**kwargs) - self.value = kwargs['value'] - self.next_link = kwargs.get('next_link', None) + super(PirSharedGalleryResource, self).__init__(**kwargs) + self.unique_id = kwargs.get('unique_id', None) -class GalleryOSDiskImage(GalleryDiskImage): - """This is the OS disk image. +class PrivateEndpoint(msrest.serialization.Model): + """The Private Endpoint resource. Variables are only populated by the server, and will be ignored when sending a request. - :ivar size_in_gb: This property indicates the size of the VHD to be created. - :vartype size_in_gb: int - :param host_caching: The host caching of the disk. Valid values are 'None', 'ReadOnly', and - 'ReadWrite'. Possible values include: "None", "ReadOnly", "ReadWrite". - :type host_caching: str or ~azure.mgmt.compute.v2020_09_30.models.HostCaching - :param source: The gallery artifact version source. - :type source: ~azure.mgmt.compute.v2020_09_30.models.GalleryArtifactVersionSource + :ivar id: The ARM identifier for Private Endpoint. + :vartype id: str """ _validation = { - 'size_in_gb': {'readonly': True}, + 'id': {'readonly': True}, } _attribute_map = { - 'size_in_gb': {'key': 'sizeInGB', 'type': 'int'}, - 'host_caching': {'key': 'hostCaching', 'type': 'str'}, - 'source': {'key': 'source', 'type': 'GalleryArtifactVersionSource'}, + 'id': {'key': 'id', 'type': 'str'}, } def __init__( self, **kwargs ): - super(GalleryOSDiskImage, self).__init__(**kwargs) + super(PrivateEndpoint, self).__init__(**kwargs) + self.id = None -class GalleryUpdate(UpdateResourceDefinition): - """Specifies information about the Shared Image Gallery that you want to update. +class PrivateEndpointConnection(ProxyOnlyResource): + """The Private Endpoint Connection resource. Variables are only populated by the server, and will be ignored when sending a request. @@ -1472,19 +2820,16 @@ class GalleryUpdate(UpdateResourceDefinition): :vartype name: str :ivar type: Resource type. :vartype type: str - :param tags: A set of tags. Resource tags. - :type tags: dict[str, str] - :param description: The description of this Shared Image Gallery resource. This property is - updatable. - :type description: str - :param identifier: Describes the gallery unique name. - :type identifier: ~azure.mgmt.compute.v2020_09_30.models.GalleryIdentifier - :ivar provisioning_state: The provisioning state, which only appears in the response. Possible - values include: "Creating", "Updating", "Failed", "Succeeded", "Deleting", "Migrating". + :param private_endpoint: The resource of private end point. + :type private_endpoint: ~azure.mgmt.compute.v2020_09_30.models.PrivateEndpoint + :param private_link_service_connection_state: A collection of information about the state of + the connection between DiskAccess and Virtual Network. + :type private_link_service_connection_state: + ~azure.mgmt.compute.v2020_09_30.models.PrivateLinkServiceConnectionState + :ivar provisioning_state: The provisioning state of the private endpoint connection resource. + Possible values include: "Succeeded", "Creating", "Deleting", "Failed". :vartype provisioning_state: str or - ~azure.mgmt.compute.v2020_09_30.models.GalleryPropertiesProvisioningState - :param sharing_profile: Profile for gallery sharing to subscription or tenant. - :type sharing_profile: ~azure.mgmt.compute.v2020_09_30.models.SharingProfile + ~azure.mgmt.compute.v2020_09_30.models.PrivateEndpointConnectionProvisioningState """ _validation = { @@ -1498,178 +2843,181 @@ class GalleryUpdate(UpdateResourceDefinition): 'id': {'key': 'id', 'type': 'str'}, 'name': {'key': 'name', 'type': 'str'}, 'type': {'key': 'type', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'description': {'key': 'properties.description', 'type': 'str'}, - 'identifier': {'key': 'properties.identifier', 'type': 'GalleryIdentifier'}, + 'private_endpoint': {'key': 'properties.privateEndpoint', 'type': 'PrivateEndpoint'}, + 'private_link_service_connection_state': {'key': 'properties.privateLinkServiceConnectionState', 'type': 'PrivateLinkServiceConnectionState'}, 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, - 'sharing_profile': {'key': 'properties.sharingProfile', 'type': 'SharingProfile'}, - } - - def __init__( - self, - **kwargs - ): - super(GalleryUpdate, self).__init__(**kwargs) - self.description = kwargs.get('description', None) - self.identifier = kwargs.get('identifier', None) - self.provisioning_state = None - self.sharing_profile = kwargs.get('sharing_profile', None) - - -class ImagePurchasePlan(msrest.serialization.Model): - """Describes the gallery image definition purchase plan. This is used by marketplace images. - - :param name: The plan ID. - :type name: str - :param publisher: The publisher ID. - :type publisher: str - :param product: The product ID. - :type product: str - """ - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'publisher': {'key': 'publisher', 'type': 'str'}, - 'product': {'key': 'product', 'type': 'str'}, } def __init__( self, **kwargs - ): - super(ImagePurchasePlan, self).__init__(**kwargs) - self.name = kwargs.get('name', None) - self.publisher = kwargs.get('publisher', None) - self.product = kwargs.get('product', None) + ): + super(PrivateEndpointConnection, self).__init__(**kwargs) + self.private_endpoint = kwargs.get('private_endpoint', None) + self.private_link_service_connection_state = kwargs.get('private_link_service_connection_state', None) + self.provisioning_state = None -class InnerError(msrest.serialization.Model): - """Inner error details. +class PrivateEndpointConnectionListResult(msrest.serialization.Model): + """A list of private link resources. - :param exceptiontype: The exception type. - :type exceptiontype: str - :param errordetail: The internal error message or exception dump. - :type errordetail: str + :param value: Array of private endpoint connections. + :type value: list[~azure.mgmt.compute.v2020_09_30.models.PrivateEndpointConnection] + :param next_link: The uri to fetch the next page of snapshots. Call ListNext() with this to + fetch the next page of snapshots. + :type next_link: str """ _attribute_map = { - 'exceptiontype': {'key': 'exceptiontype', 'type': 'str'}, - 'errordetail': {'key': 'errordetail', 'type': 'str'}, + 'value': {'key': 'value', 'type': '[PrivateEndpointConnection]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, } def __init__( self, **kwargs ): - super(InnerError, self).__init__(**kwargs) - self.exceptiontype = kwargs.get('exceptiontype', None) - self.errordetail = kwargs.get('errordetail', None) + super(PrivateEndpointConnectionListResult, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + self.next_link = kwargs.get('next_link', None) -class ManagedArtifact(msrest.serialization.Model): - """The managed artifact. +class PrivateLinkResource(msrest.serialization.Model): + """A private link resource. - All required parameters must be populated in order to send to Azure. + Variables are only populated by the server, and will be ignored when sending a request. - :param id: Required. The managed artifact id. - :type id: str + :ivar id: private link resource Id. + :vartype id: str + :ivar name: private link resource name. + :vartype name: str + :ivar type: private link resource type. + :vartype type: str + :ivar group_id: The private link resource group id. + :vartype group_id: str + :ivar required_members: The private link resource required member names. + :vartype required_members: list[str] + :param required_zone_names: The private link resource DNS zone name. + :type required_zone_names: list[str] """ _validation = { - 'id': {'required': True}, + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'group_id': {'readonly': True}, + 'required_members': {'readonly': True}, } _attribute_map = { 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'group_id': {'key': 'properties.groupId', 'type': 'str'}, + 'required_members': {'key': 'properties.requiredMembers', 'type': '[str]'}, + 'required_zone_names': {'key': 'properties.requiredZoneNames', 'type': '[str]'}, } def __init__( self, **kwargs ): - super(ManagedArtifact, self).__init__(**kwargs) - self.id = kwargs['id'] + super(PrivateLinkResource, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None + self.group_id = None + self.required_members = None + self.required_zone_names = kwargs.get('required_zone_names', None) -class OSDiskImageEncryption(DiskImageEncryption): - """Contains encryption settings for an OS disk image. +class PrivateLinkResourceListResult(msrest.serialization.Model): + """A list of private link resources. - :param disk_encryption_set_id: A relative URI containing the resource ID of the disk encryption - set. - :type disk_encryption_set_id: str + :param value: Array of private link resources. + :type value: list[~azure.mgmt.compute.v2020_09_30.models.PrivateLinkResource] """ _attribute_map = { - 'disk_encryption_set_id': {'key': 'diskEncryptionSetId', 'type': 'str'}, + 'value': {'key': 'value', 'type': '[PrivateLinkResource]'}, } def __init__( self, **kwargs ): - super(OSDiskImageEncryption, self).__init__(**kwargs) - + super(PrivateLinkResourceListResult, self).__init__(**kwargs) + self.value = kwargs.get('value', None) -class PirResource(msrest.serialization.Model): - """The Resource model definition. - Variables are only populated by the server, and will be ignored when sending a request. +class PrivateLinkServiceConnectionState(msrest.serialization.Model): + """A collection of information about the state of the connection between service consumer and provider. - :ivar name: Resource name. - :vartype name: str - :ivar location: Resource location. - :vartype location: str + :param status: Indicates whether the connection has been Approved/Rejected/Removed by the owner + of the service. Possible values include: "Pending", "Approved", "Rejected". + :type status: str or + ~azure.mgmt.compute.v2020_09_30.models.PrivateEndpointServiceConnectionStatus + :param description: The reason for approval/rejection of the connection. + :type description: str + :param actions_required: A message indicating if changes on the service provider require any + updates on the consumer. + :type actions_required: str """ - _validation = { - 'name': {'readonly': True}, - 'location': {'readonly': True}, - } - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'location': {'key': 'location', 'type': 'str'}, + 'status': {'key': 'status', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + 'actions_required': {'key': 'actionsRequired', 'type': 'str'}, } def __init__( self, **kwargs ): - super(PirResource, self).__init__(**kwargs) - self.name = None - self.location = None + super(PrivateLinkServiceConnectionState, self).__init__(**kwargs) + self.status = kwargs.get('status', None) + self.description = kwargs.get('description', None) + self.actions_required = kwargs.get('actions_required', None) -class PirSharedGalleryResource(PirResource): - """Base information about the shared gallery resource in pir. +class PurchasePlan(msrest.serialization.Model): + """Used for establishing the purchase context of any 3rd Party artifact through MarketPlace. - 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 name: Resource name. - :vartype name: str - :ivar location: Resource location. - :vartype location: str - :param unique_id: The unique id of this shared gallery. - :type unique_id: str + :param name: Required. The plan ID. + :type name: str + :param publisher: Required. The publisher ID. + :type publisher: str + :param product: Required. Specifies the product of the image from the marketplace. This is the + same value as Offer under the imageReference element. + :type product: str + :param promotion_code: The Offer Promotion Code. + :type promotion_code: str """ _validation = { - 'name': {'readonly': True}, - 'location': {'readonly': True}, + 'name': {'required': True}, + 'publisher': {'required': True}, + 'product': {'required': True}, } _attribute_map = { 'name': {'key': 'name', 'type': 'str'}, - 'location': {'key': 'location', 'type': 'str'}, - 'unique_id': {'key': 'identifier.uniqueId', 'type': 'str'}, + 'publisher': {'key': 'publisher', 'type': 'str'}, + 'product': {'key': 'product', 'type': 'str'}, + 'promotion_code': {'key': 'promotionCode', 'type': 'str'}, } def __init__( self, **kwargs ): - super(PirSharedGalleryResource, self).__init__(**kwargs) - self.unique_id = kwargs.get('unique_id', None) + super(PurchasePlan, self).__init__(**kwargs) + self.name = kwargs['name'] + self.publisher = kwargs['publisher'] + self.product = kwargs['product'] + self.promotion_code = kwargs.get('promotion_code', None) class RecommendedMachineConfiguration(msrest.serialization.Model): @@ -1792,6 +3140,37 @@ def __init__( self.max = kwargs.get('max', None) +class ResourceUriList(msrest.serialization.Model): + """The List resources which are encrypted with the disk encryption set. + + All required parameters must be populated in order to send to Azure. + + :param value: Required. A list of IDs or Owner IDs of resources which are encrypted with the + disk encryption set. + :type value: list[str] + :param next_link: The uri to fetch the next page of encrypted resources. Call ListNext() with + this to fetch the next page of encrypted resources. + :type next_link: str + """ + + _validation = { + 'value': {'required': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[str]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ResourceUriList, self).__init__(**kwargs) + self.value = kwargs['value'] + self.next_link = kwargs.get('next_link', None) + + class SharedGallery(PirSharedGalleryResource): """Specifies information about the Shared Gallery that you want to create or update. @@ -2030,6 +3409,31 @@ def __init__( self.next_link = kwargs.get('next_link', None) +class ShareInfoElement(msrest.serialization.Model): + """ShareInfoElement. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar vm_uri: A relative URI containing the ID of the VM that has the disk attached. + :vartype vm_uri: str + """ + + _validation = { + 'vm_uri': {'readonly': True}, + } + + _attribute_map = { + 'vm_uri': {'key': 'vmUri', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ShareInfoElement, self).__init__(**kwargs) + self.vm_uri = None + + class SharingProfile(msrest.serialization.Model): """Profile for gallery sharing to subscription or tenant. @@ -2119,6 +3523,275 @@ def __init__( self.groups = kwargs.get('groups', None) +class Snapshot(Resource): + """Snapshot resource. + + 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: Resource Id. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param location: Required. Resource location. + :type location: str + :param tags: A set of tags. Resource tags. + :type tags: dict[str, str] + :ivar managed_by: Unused. Always Null. + :vartype managed_by: str + :param sku: The snapshots sku name. Can be Standard_LRS, Premium_LRS, or Standard_ZRS. This is + an optional parameter for incremental snapshot and the default behavior is the SKU will be set + to the same sku as the previous snapshot. + :type sku: ~azure.mgmt.compute.v2020_09_30.models.SnapshotSku + :param extended_location: The extended location where the snapshot will be created. Extended + location cannot be changed. + :type extended_location: ~azure.mgmt.compute.v2020_09_30.models.ExtendedLocation + :ivar time_created: The time when the snapshot was created. + :vartype time_created: ~datetime.datetime + :param os_type: The Operating System type. Possible values include: "Windows", "Linux". + :type os_type: str or ~azure.mgmt.compute.v2020_09_30.models.OperatingSystemTypes + :param hyper_v_generation: The hypervisor generation of the Virtual Machine. Applicable to OS + disks only. Possible values include: "V1", "V2". + :type hyper_v_generation: str or ~azure.mgmt.compute.v2020_09_30.models.HyperVGeneration + :param purchase_plan: Purchase plan information for the image from which the source disk for + the snapshot was originally created. + :type purchase_plan: ~azure.mgmt.compute.v2020_09_30.models.PurchasePlan + :param creation_data: Disk source information. CreationData information cannot be changed after + the disk has been created. + :type creation_data: ~azure.mgmt.compute.v2020_09_30.models.CreationData + :param disk_size_gb: If creationData.createOption is Empty, this field is mandatory and it + indicates the size of the disk to create. If this field is present for updates or creation with + other options, it indicates a resize. Resizes are only allowed if the disk is not attached to a + running VM, and can only increase the disk's size. + :type disk_size_gb: int + :ivar disk_size_bytes: The size of the disk in bytes. This field is read only. + :vartype disk_size_bytes: long + :ivar disk_state: The state of the snapshot. Possible values include: "Unattached", "Attached", + "Reserved", "ActiveSAS", "ReadyToUpload", "ActiveUpload". + :vartype disk_state: str or ~azure.mgmt.compute.v2020_09_30.models.DiskState + :ivar unique_id: Unique Guid identifying the resource. + :vartype unique_id: str + :param encryption_settings_collection: Encryption settings collection used be Azure Disk + Encryption, can contain multiple encryption settings per disk or snapshot. + :type encryption_settings_collection: + ~azure.mgmt.compute.v2020_09_30.models.EncryptionSettingsCollection + :ivar provisioning_state: The disk provisioning state. + :vartype provisioning_state: str + :param incremental: Whether a snapshot is incremental. Incremental snapshots on the same disk + occupy less space than full snapshots and can be diffed. + :type incremental: bool + :param encryption: Encryption property can be used to encrypt data at rest with customer + managed keys or platform managed keys. + :type encryption: ~azure.mgmt.compute.v2020_09_30.models.Encryption + :param network_access_policy: Policy for accessing the disk via network. Possible values + include: "AllowAll", "AllowPrivate", "DenyAll". + :type network_access_policy: str or ~azure.mgmt.compute.v2020_09_30.models.NetworkAccessPolicy + :param disk_access_id: ARM id of the DiskAccess resource for using private endpoints on disks. + :type disk_access_id: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': True}, + 'managed_by': {'readonly': True}, + 'time_created': {'readonly': True}, + 'disk_size_bytes': {'readonly': True}, + 'disk_state': {'readonly': True}, + 'unique_id': {'readonly': True}, + 'provisioning_state': {'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}'}, + 'managed_by': {'key': 'managedBy', 'type': 'str'}, + 'sku': {'key': 'sku', 'type': 'SnapshotSku'}, + 'extended_location': {'key': 'extendedLocation', 'type': 'ExtendedLocation'}, + 'time_created': {'key': 'properties.timeCreated', 'type': 'iso-8601'}, + 'os_type': {'key': 'properties.osType', 'type': 'str'}, + 'hyper_v_generation': {'key': 'properties.hyperVGeneration', 'type': 'str'}, + 'purchase_plan': {'key': 'properties.purchasePlan', 'type': 'PurchasePlan'}, + 'creation_data': {'key': 'properties.creationData', 'type': 'CreationData'}, + 'disk_size_gb': {'key': 'properties.diskSizeGB', 'type': 'int'}, + 'disk_size_bytes': {'key': 'properties.diskSizeBytes', 'type': 'long'}, + 'disk_state': {'key': 'properties.diskState', 'type': 'str'}, + 'unique_id': {'key': 'properties.uniqueId', 'type': 'str'}, + 'encryption_settings_collection': {'key': 'properties.encryptionSettingsCollection', 'type': 'EncryptionSettingsCollection'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'incremental': {'key': 'properties.incremental', 'type': 'bool'}, + 'encryption': {'key': 'properties.encryption', 'type': 'Encryption'}, + 'network_access_policy': {'key': 'properties.networkAccessPolicy', 'type': 'str'}, + 'disk_access_id': {'key': 'properties.diskAccessId', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(Snapshot, self).__init__(**kwargs) + self.managed_by = None + self.sku = kwargs.get('sku', None) + self.extended_location = kwargs.get('extended_location', None) + self.time_created = None + self.os_type = kwargs.get('os_type', None) + self.hyper_v_generation = kwargs.get('hyper_v_generation', None) + self.purchase_plan = kwargs.get('purchase_plan', None) + self.creation_data = kwargs.get('creation_data', None) + self.disk_size_gb = kwargs.get('disk_size_gb', None) + self.disk_size_bytes = None + self.disk_state = None + self.unique_id = None + self.encryption_settings_collection = kwargs.get('encryption_settings_collection', None) + self.provisioning_state = None + self.incremental = kwargs.get('incremental', None) + self.encryption = kwargs.get('encryption', None) + self.network_access_policy = kwargs.get('network_access_policy', None) + self.disk_access_id = kwargs.get('disk_access_id', None) + + +class SnapshotList(msrest.serialization.Model): + """The List Snapshots operation response. + + All required parameters must be populated in order to send to Azure. + + :param value: Required. A list of snapshots. + :type value: list[~azure.mgmt.compute.v2020_09_30.models.Snapshot] + :param next_link: The uri to fetch the next page of snapshots. Call ListNext() with this to + fetch the next page of snapshots. + :type next_link: str + """ + + _validation = { + 'value': {'required': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[Snapshot]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(SnapshotList, self).__init__(**kwargs) + self.value = kwargs['value'] + self.next_link = kwargs.get('next_link', None) + + +class SnapshotSku(msrest.serialization.Model): + """The snapshots sku name. Can be Standard_LRS, Premium_LRS, or Standard_ZRS. This is an optional parameter for incremental snapshot and the default behavior is the SKU will be set to the same sku as the previous snapshot. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param name: The sku name. Possible values include: "Standard_LRS", "Premium_LRS", + "Standard_ZRS". + :type name: str or ~azure.mgmt.compute.v2020_09_30.models.SnapshotStorageAccountTypes + :ivar tier: The sku tier. + :vartype tier: str + """ + + _validation = { + 'tier': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'tier': {'key': 'tier', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(SnapshotSku, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.tier = None + + +class SnapshotUpdate(msrest.serialization.Model): + """Snapshot update resource. + + :param tags: A set of tags. Resource tags. + :type tags: dict[str, str] + :param sku: The snapshots sku name. Can be Standard_LRS, Premium_LRS, or Standard_ZRS. This is + an optional parameter for incremental snapshot and the default behavior is the SKU will be set + to the same sku as the previous snapshot. + :type sku: ~azure.mgmt.compute.v2020_09_30.models.SnapshotSku + :param os_type: the Operating System type. Possible values include: "Windows", "Linux". + :type os_type: str or ~azure.mgmt.compute.v2020_09_30.models.OperatingSystemTypes + :param disk_size_gb: If creationData.createOption is Empty, this field is mandatory and it + indicates the size of the disk to create. If this field is present for updates or creation with + other options, it indicates a resize. Resizes are only allowed if the disk is not attached to a + running VM, and can only increase the disk's size. + :type disk_size_gb: int + :param encryption_settings_collection: Encryption settings collection used be Azure Disk + Encryption, can contain multiple encryption settings per disk or snapshot. + :type encryption_settings_collection: + ~azure.mgmt.compute.v2020_09_30.models.EncryptionSettingsCollection + :param encryption: Encryption property can be used to encrypt data at rest with customer + managed keys or platform managed keys. + :type encryption: ~azure.mgmt.compute.v2020_09_30.models.Encryption + :param network_access_policy: Policy for accessing the disk via network. Possible values + include: "AllowAll", "AllowPrivate", "DenyAll". + :type network_access_policy: str or ~azure.mgmt.compute.v2020_09_30.models.NetworkAccessPolicy + :param disk_access_id: ARM id of the DiskAccess resource for using private endpoints on disks. + :type disk_access_id: str + """ + + _attribute_map = { + 'tags': {'key': 'tags', 'type': '{str}'}, + 'sku': {'key': 'sku', 'type': 'SnapshotSku'}, + 'os_type': {'key': 'properties.osType', 'type': 'str'}, + 'disk_size_gb': {'key': 'properties.diskSizeGB', 'type': 'int'}, + 'encryption_settings_collection': {'key': 'properties.encryptionSettingsCollection', 'type': 'EncryptionSettingsCollection'}, + 'encryption': {'key': 'properties.encryption', 'type': 'Encryption'}, + 'network_access_policy': {'key': 'properties.networkAccessPolicy', 'type': 'str'}, + 'disk_access_id': {'key': 'properties.diskAccessId', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(SnapshotUpdate, self).__init__(**kwargs) + self.tags = kwargs.get('tags', None) + self.sku = kwargs.get('sku', None) + self.os_type = kwargs.get('os_type', None) + self.disk_size_gb = kwargs.get('disk_size_gb', None) + self.encryption_settings_collection = kwargs.get('encryption_settings_collection', None) + self.encryption = kwargs.get('encryption', None) + self.network_access_policy = kwargs.get('network_access_policy', None) + self.disk_access_id = kwargs.get('disk_access_id', None) + + +class SourceVault(msrest.serialization.Model): + """The vault id is an Azure Resource Manager Resource id in the form /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.KeyVault/vaults/{vaultName}. + + :param id: Resource Id. + :type id: str + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(SourceVault, self).__init__(**kwargs) + self.id = kwargs.get('id', None) + + class TargetRegion(msrest.serialization.Model): """Describes the target region information. diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_09_30/models/_models_py3.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_09_30/models/_models_py3.py index b07b455530c1..cebfade08f79 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_09_30/models/_models_py3.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_09_30/models/_models_py3.py @@ -14,6 +14,31 @@ from ._compute_management_client_enums import * +class AccessUri(msrest.serialization.Model): + """A disk access SAS uri. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar access_sas: A SAS uri for accessing a disk. + :vartype access_sas: str + """ + + _validation = { + 'access_sas': {'readonly': True}, + } + + _attribute_map = { + 'access_sas': {'key': 'accessSAS', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(AccessUri, self).__init__(**kwargs) + self.access_sas = None + + class ApiError(msrest.serialization.Model): """Api error. @@ -86,6 +111,85 @@ def __init__( self.message = message +class CreationData(msrest.serialization.Model): + """Data used when creating a disk. + + 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. + + :param create_option: Required. This enumerates the possible sources of a disk's creation. + Possible values include: "Empty", "Attach", "FromImage", "Import", "Copy", "Restore", "Upload". + :type create_option: str or ~azure.mgmt.compute.v2020_09_30.models.DiskCreateOption + :param storage_account_id: Required if createOption is Import. The Azure Resource Manager + identifier of the storage account containing the blob to import as a disk. + :type storage_account_id: str + :param image_reference: Disk source information. + :type image_reference: ~azure.mgmt.compute.v2020_09_30.models.ImageDiskReference + :param gallery_image_reference: Required if creating from a Gallery Image. The id of the + ImageDiskReference will be the ARM id of the shared galley image version from which to create a + disk. + :type gallery_image_reference: ~azure.mgmt.compute.v2020_09_30.models.ImageDiskReference + :param source_uri: If createOption is Import, this is the URI of a blob to be imported into a + managed disk. + :type source_uri: str + :param source_resource_id: If createOption is Copy, this is the ARM id of the source snapshot + or disk. + :type source_resource_id: str + :ivar source_unique_id: If this field is set, this is the unique id identifying the source of + this resource. + :vartype source_unique_id: str + :param upload_size_bytes: If createOption is Upload, this is the size of the contents of the + upload including the VHD footer. This value should be between 20972032 (20 MiB + 512 bytes for + the VHD footer) and 35183298347520 bytes (32 TiB + 512 bytes for the VHD footer). + :type upload_size_bytes: long + :param logical_sector_size: Logical sector size in bytes for Ultra disks. Supported values are + 512 ad 4096. 4096 is the default. + :type logical_sector_size: int + """ + + _validation = { + 'create_option': {'required': True}, + 'source_unique_id': {'readonly': True}, + } + + _attribute_map = { + 'create_option': {'key': 'createOption', 'type': 'str'}, + 'storage_account_id': {'key': 'storageAccountId', 'type': 'str'}, + 'image_reference': {'key': 'imageReference', 'type': 'ImageDiskReference'}, + 'gallery_image_reference': {'key': 'galleryImageReference', 'type': 'ImageDiskReference'}, + 'source_uri': {'key': 'sourceUri', 'type': 'str'}, + 'source_resource_id': {'key': 'sourceResourceId', 'type': 'str'}, + 'source_unique_id': {'key': 'sourceUniqueId', 'type': 'str'}, + 'upload_size_bytes': {'key': 'uploadSizeBytes', 'type': 'long'}, + 'logical_sector_size': {'key': 'logicalSectorSize', 'type': 'int'}, + } + + def __init__( + self, + *, + create_option: Union[str, "DiskCreateOption"], + storage_account_id: Optional[str] = None, + image_reference: Optional["ImageDiskReference"] = None, + gallery_image_reference: Optional["ImageDiskReference"] = None, + source_uri: Optional[str] = None, + source_resource_id: Optional[str] = None, + upload_size_bytes: Optional[int] = None, + logical_sector_size: Optional[int] = None, + **kwargs + ): + super(CreationData, self).__init__(**kwargs) + self.create_option = create_option + self.storage_account_id = storage_account_id + self.image_reference = image_reference + self.gallery_image_reference = gallery_image_reference + self.source_uri = source_uri + self.source_resource_id = source_resource_id + self.source_unique_id = None + self.upload_size_bytes = upload_size_bytes + self.logical_sector_size = logical_sector_size + + class DiskImageEncryption(msrest.serialization.Model): """This is the disk image encryption base class. @@ -163,32 +267,6 @@ def __init__( self.disk_types = disk_types -class EncryptionImages(msrest.serialization.Model): - """Optional. Allows users to provide customer managed keys for encrypting the OS and data disks in the gallery artifact. - - :param os_disk_image: This is the disk image encryption base class. - :type os_disk_image: ~azure.mgmt.compute.v2020_09_30.models.DiskImageEncryption - :param data_disk_images: A list of encryption specifications for data disk images. - :type data_disk_images: list[~azure.mgmt.compute.v2020_09_30.models.DataDiskImageEncryption] - """ - - _attribute_map = { - 'os_disk_image': {'key': 'osDiskImage', 'type': 'DiskImageEncryption'}, - 'data_disk_images': {'key': 'dataDiskImages', 'type': '[DataDiskImageEncryption]'}, - } - - def __init__( - self, - *, - os_disk_image: Optional["DiskImageEncryption"] = None, - data_disk_images: Optional[List["DataDiskImageEncryption"]] = None, - **kwargs - ): - super(EncryptionImages, self).__init__(**kwargs) - self.os_disk_image = os_disk_image - self.data_disk_images = data_disk_images - - class Resource(msrest.serialization.Model): """The Resource model definition. @@ -238,8 +316,8 @@ def __init__( self.tags = tags -class Gallery(Resource): - """Specifies information about the Shared Image Gallery that you want to create or update. +class Disk(Resource): + """Disk resource. Variables are only populated by the server, and will be ignored when sending a request. @@ -255,17 +333,87 @@ class Gallery(Resource): :type location: str :param tags: A set of tags. Resource tags. :type tags: dict[str, str] - :param description: The description of this Shared Image Gallery resource. This property is - updatable. - :type description: str - :param identifier: Describes the gallery unique name. - :type identifier: ~azure.mgmt.compute.v2020_09_30.models.GalleryIdentifier - :ivar provisioning_state: The provisioning state, which only appears in the response. Possible - values include: "Creating", "Updating", "Failed", "Succeeded", "Deleting", "Migrating". - :vartype provisioning_state: str or - ~azure.mgmt.compute.v2020_09_30.models.GalleryPropertiesProvisioningState - :param sharing_profile: Profile for gallery sharing to subscription or tenant. - :type sharing_profile: ~azure.mgmt.compute.v2020_09_30.models.SharingProfile + :ivar managed_by: A relative URI containing the ID of the VM that has the disk attached. + :vartype managed_by: str + :ivar managed_by_extended: List of relative URIs containing the IDs of the VMs that have the + disk attached. maxShares should be set to a value greater than one for disks to allow attaching + them to multiple VMs. + :vartype managed_by_extended: list[str] + :param sku: The disks sku name. Can be Standard_LRS, Premium_LRS, StandardSSD_LRS, or + UltraSSD_LRS. + :type sku: ~azure.mgmt.compute.v2020_09_30.models.DiskSku + :param zones: The Logical zone list for Disk. + :type zones: list[str] + :param extended_location: The extended location where the disk will be created. Extended + location cannot be changed. + :type extended_location: ~azure.mgmt.compute.v2020_09_30.models.ExtendedLocation + :ivar time_created: The time when the disk was created. + :vartype time_created: ~datetime.datetime + :param os_type: The Operating System type. Possible values include: "Windows", "Linux". + :type os_type: str or ~azure.mgmt.compute.v2020_09_30.models.OperatingSystemTypes + :param hyper_v_generation: The hypervisor generation of the Virtual Machine. Applicable to OS + disks only. Possible values include: "V1", "V2". + :type hyper_v_generation: str or ~azure.mgmt.compute.v2020_09_30.models.HyperVGeneration + :param purchase_plan: Purchase plan information for the the image from which the OS disk was + created. E.g. - {name: 2019-Datacenter, publisher: MicrosoftWindowsServer, product: + WindowsServer}. + :type purchase_plan: ~azure.mgmt.compute.v2020_09_30.models.PurchasePlan + :param creation_data: Disk source information. CreationData information cannot be changed after + the disk has been created. + :type creation_data: ~azure.mgmt.compute.v2020_09_30.models.CreationData + :param disk_size_gb: If creationData.createOption is Empty, this field is mandatory and it + indicates the size of the disk to create. If this field is present for updates or creation with + other options, it indicates a resize. Resizes are only allowed if the disk is not attached to a + running VM, and can only increase the disk's size. + :type disk_size_gb: int + :ivar disk_size_bytes: The size of the disk in bytes. This field is read only. + :vartype disk_size_bytes: long + :ivar unique_id: Unique Guid identifying the resource. + :vartype unique_id: str + :param encryption_settings_collection: Encryption settings collection used for Azure Disk + Encryption, can contain multiple encryption settings per disk or snapshot. + :type encryption_settings_collection: + ~azure.mgmt.compute.v2020_09_30.models.EncryptionSettingsCollection + :ivar provisioning_state: The disk provisioning state. + :vartype provisioning_state: str + :param disk_iops_read_write: The number of IOPS allowed for this disk; only settable for + UltraSSD disks. One operation can transfer between 4k and 256k bytes. + :type disk_iops_read_write: long + :param disk_m_bps_read_write: The bandwidth allowed for this disk; only settable for UltraSSD + disks. MBps means millions of bytes per second - MB here uses the ISO notation, of powers of + 10. + :type disk_m_bps_read_write: long + :param disk_iops_read_only: The total number of IOPS that will be allowed across all VMs + mounting the shared disk as ReadOnly. One operation can transfer between 4k and 256k bytes. + :type disk_iops_read_only: long + :param disk_m_bps_read_only: The total throughput (MBps) that will be allowed across all VMs + mounting the shared disk as ReadOnly. MBps means millions of bytes per second - MB here uses + the ISO notation, of powers of 10. + :type disk_m_bps_read_only: long + :ivar disk_state: The state of the disk. Possible values include: "Unattached", "Attached", + "Reserved", "ActiveSAS", "ReadyToUpload", "ActiveUpload". + :vartype disk_state: str or ~azure.mgmt.compute.v2020_09_30.models.DiskState + :param encryption: Encryption property can be used to encrypt data at rest with customer + managed keys or platform managed keys. + :type encryption: ~azure.mgmt.compute.v2020_09_30.models.Encryption + :param max_shares: The maximum number of VMs that can attach to the disk at the same time. + Value greater than one indicates a disk that can be mounted on multiple VMs at the same time. + :type max_shares: int + :ivar share_info: Details of the list of all VMs that have the disk attached. maxShares should + be set to a value greater than one for disks to allow attaching them to multiple VMs. + :vartype share_info: list[~azure.mgmt.compute.v2020_09_30.models.ShareInfoElement] + :param network_access_policy: Policy for accessing the disk via network. Possible values + include: "AllowAll", "AllowPrivate", "DenyAll". + :type network_access_policy: str or ~azure.mgmt.compute.v2020_09_30.models.NetworkAccessPolicy + :param disk_access_id: ARM id of the DiskAccess resource for using private endpoints on disks. + :type disk_access_id: str + :param tier: Performance tier of the disk (e.g, P4, S10) as described here: + https://azure.microsoft.com/en-us/pricing/details/managed-disks/. Does not apply to Ultra + disks. + :type tier: str + :param bursting_enabled: Set to true to enable bursting beyond the provisioned performance + target of the disk. Bursting is disabled by default. Does not apply to Ultra disks. + :type bursting_enabled: bool """ _validation = { @@ -273,7 +421,14 @@ class Gallery(Resource): 'name': {'readonly': True}, 'type': {'readonly': True}, 'location': {'required': True}, + 'managed_by': {'readonly': True}, + 'managed_by_extended': {'readonly': True}, + 'time_created': {'readonly': True}, + 'disk_size_bytes': {'readonly': True}, + 'unique_id': {'readonly': True}, 'provisioning_state': {'readonly': True}, + 'disk_state': {'readonly': True}, + 'share_info': {'readonly': True}, } _attribute_map = { @@ -282,10 +437,33 @@ class Gallery(Resource): 'type': {'key': 'type', 'type': 'str'}, 'location': {'key': 'location', 'type': 'str'}, 'tags': {'key': 'tags', 'type': '{str}'}, - 'description': {'key': 'properties.description', 'type': 'str'}, - 'identifier': {'key': 'properties.identifier', 'type': 'GalleryIdentifier'}, + 'managed_by': {'key': 'managedBy', 'type': 'str'}, + 'managed_by_extended': {'key': 'managedByExtended', 'type': '[str]'}, + 'sku': {'key': 'sku', 'type': 'DiskSku'}, + 'zones': {'key': 'zones', 'type': '[str]'}, + 'extended_location': {'key': 'extendedLocation', 'type': 'ExtendedLocation'}, + 'time_created': {'key': 'properties.timeCreated', 'type': 'iso-8601'}, + 'os_type': {'key': 'properties.osType', 'type': 'str'}, + 'hyper_v_generation': {'key': 'properties.hyperVGeneration', 'type': 'str'}, + 'purchase_plan': {'key': 'properties.purchasePlan', 'type': 'PurchasePlan'}, + 'creation_data': {'key': 'properties.creationData', 'type': 'CreationData'}, + 'disk_size_gb': {'key': 'properties.diskSizeGB', 'type': 'int'}, + 'disk_size_bytes': {'key': 'properties.diskSizeBytes', 'type': 'long'}, + 'unique_id': {'key': 'properties.uniqueId', 'type': 'str'}, + 'encryption_settings_collection': {'key': 'properties.encryptionSettingsCollection', 'type': 'EncryptionSettingsCollection'}, 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, - 'sharing_profile': {'key': 'properties.sharingProfile', 'type': 'SharingProfile'}, + 'disk_iops_read_write': {'key': 'properties.diskIOPSReadWrite', 'type': 'long'}, + 'disk_m_bps_read_write': {'key': 'properties.diskMBpsReadWrite', 'type': 'long'}, + 'disk_iops_read_only': {'key': 'properties.diskIOPSReadOnly', 'type': 'long'}, + 'disk_m_bps_read_only': {'key': 'properties.diskMBpsReadOnly', 'type': 'long'}, + 'disk_state': {'key': 'properties.diskState', 'type': 'str'}, + 'encryption': {'key': 'properties.encryption', 'type': 'Encryption'}, + 'max_shares': {'key': 'properties.maxShares', 'type': 'int'}, + 'share_info': {'key': 'properties.shareInfo', 'type': '[ShareInfoElement]'}, + 'network_access_policy': {'key': 'properties.networkAccessPolicy', 'type': 'str'}, + 'disk_access_id': {'key': 'properties.diskAccessId', 'type': 'str'}, + 'tier': {'key': 'properties.tier', 'type': 'str'}, + 'bursting_enabled': {'key': 'properties.burstingEnabled', 'type': 'bool'}, } def __init__( @@ -293,20 +471,59 @@ def __init__( *, location: str, tags: Optional[Dict[str, str]] = None, - description: Optional[str] = None, - identifier: Optional["GalleryIdentifier"] = None, - sharing_profile: Optional["SharingProfile"] = None, + sku: Optional["DiskSku"] = None, + zones: Optional[List[str]] = None, + extended_location: Optional["ExtendedLocation"] = None, + os_type: Optional[Union[str, "OperatingSystemTypes"]] = None, + hyper_v_generation: Optional[Union[str, "HyperVGeneration"]] = None, + purchase_plan: Optional["PurchasePlan"] = None, + creation_data: Optional["CreationData"] = None, + disk_size_gb: Optional[int] = None, + encryption_settings_collection: Optional["EncryptionSettingsCollection"] = None, + disk_iops_read_write: Optional[int] = None, + disk_m_bps_read_write: Optional[int] = None, + disk_iops_read_only: Optional[int] = None, + disk_m_bps_read_only: Optional[int] = None, + encryption: Optional["Encryption"] = None, + max_shares: Optional[int] = None, + network_access_policy: Optional[Union[str, "NetworkAccessPolicy"]] = None, + disk_access_id: Optional[str] = None, + tier: Optional[str] = None, + bursting_enabled: Optional[bool] = None, **kwargs ): - super(Gallery, self).__init__(location=location, tags=tags, **kwargs) - self.description = description - self.identifier = identifier + super(Disk, self).__init__(location=location, tags=tags, **kwargs) + self.managed_by = None + self.managed_by_extended = None + self.sku = sku + self.zones = zones + self.extended_location = extended_location + self.time_created = None + self.os_type = os_type + self.hyper_v_generation = hyper_v_generation + self.purchase_plan = purchase_plan + self.creation_data = creation_data + self.disk_size_gb = disk_size_gb + self.disk_size_bytes = None + self.unique_id = None + self.encryption_settings_collection = encryption_settings_collection self.provisioning_state = None - self.sharing_profile = sharing_profile + self.disk_iops_read_write = disk_iops_read_write + self.disk_m_bps_read_write = disk_m_bps_read_write + self.disk_iops_read_only = disk_iops_read_only + self.disk_m_bps_read_only = disk_m_bps_read_only + self.disk_state = None + self.encryption = encryption + self.max_shares = max_shares + self.share_info = None + self.network_access_policy = network_access_policy + self.disk_access_id = disk_access_id + self.tier = tier + self.bursting_enabled = bursting_enabled -class GalleryApplication(Resource): - """Specifies information about the gallery Application Definition that you want to create or update. +class DiskAccess(Resource): + """disk access resource. Variables are only populated by the server, and will be ignored when sending a request. @@ -322,23 +539,14 @@ class GalleryApplication(Resource): :type location: str :param tags: A set of tags. Resource tags. :type tags: dict[str, str] - :param description: The description of this gallery Application Definition resource. This - property is updatable. - :type description: str - :param eula: The Eula agreement for the gallery Application Definition. - :type eula: str - :param privacy_statement_uri: The privacy statement uri. - :type privacy_statement_uri: str - :param release_note_uri: The release note uri. - :type release_note_uri: str - :param end_of_life_date: The end of life date of the gallery Application Definition. This - property can be used for decommissioning purposes. This property is updatable. - :type end_of_life_date: ~datetime.datetime - :param supported_os_type: This property allows you to specify the supported type of the OS that - application is built for. :code:`
`:code:`
` Possible values are: - :code:`
`:code:`
` **Windows** :code:`
`:code:`
` **Linux**. Possible values - include: "Windows", "Linux". - :type supported_os_type: str or ~azure.mgmt.compute.v2020_09_30.models.OperatingSystemTypes + :ivar private_endpoint_connections: A readonly collection of private endpoint connections + created on the disk. Currently only one endpoint connection is supported. + :vartype private_endpoint_connections: + list[~azure.mgmt.compute.v2020_09_30.models.PrivateEndpointConnection] + :ivar provisioning_state: The disk access resource provisioning state. + :vartype provisioning_state: str + :ivar time_created: The time when the disk access was created. + :vartype time_created: ~datetime.datetime """ _validation = { @@ -346,6 +554,9 @@ class GalleryApplication(Resource): 'name': {'readonly': True}, 'type': {'readonly': True}, 'location': {'required': True}, + 'private_endpoint_connections': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + 'time_created': {'readonly': True}, } _attribute_map = { @@ -354,12 +565,9 @@ class GalleryApplication(Resource): 'type': {'key': 'type', 'type': 'str'}, 'location': {'key': 'location', 'type': 'str'}, 'tags': {'key': 'tags', 'type': '{str}'}, - 'description': {'key': 'properties.description', 'type': 'str'}, - 'eula': {'key': 'properties.eula', 'type': 'str'}, - 'privacy_statement_uri': {'key': 'properties.privacyStatementUri', 'type': 'str'}, - 'release_note_uri': {'key': 'properties.releaseNoteUri', 'type': 'str'}, - 'end_of_life_date': {'key': 'properties.endOfLifeDate', 'type': 'iso-8601'}, - 'supported_os_type': {'key': 'properties.supportedOSType', 'type': 'str'}, + 'private_endpoint_connections': {'key': 'properties.privateEndpointConnections', 'type': '[PrivateEndpointConnection]'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'time_created': {'key': 'properties.timeCreated', 'type': 'iso-8601'}, } def __init__( @@ -367,32 +575,23 @@ def __init__( *, location: str, tags: Optional[Dict[str, str]] = None, - description: Optional[str] = None, - eula: Optional[str] = None, - privacy_statement_uri: Optional[str] = None, - release_note_uri: Optional[str] = None, - end_of_life_date: Optional[datetime.datetime] = None, - supported_os_type: Optional[Union[str, "OperatingSystemTypes"]] = None, **kwargs ): - super(GalleryApplication, self).__init__(location=location, tags=tags, **kwargs) - self.description = description - self.eula = eula - self.privacy_statement_uri = privacy_statement_uri - self.release_note_uri = release_note_uri - self.end_of_life_date = end_of_life_date - self.supported_os_type = supported_os_type + super(DiskAccess, self).__init__(location=location, tags=tags, **kwargs) + self.private_endpoint_connections = None + self.provisioning_state = None + self.time_created = None -class GalleryApplicationList(msrest.serialization.Model): - """The List Gallery Applications operation response. +class DiskAccessList(msrest.serialization.Model): + """The List disk access operation response. All required parameters must be populated in order to send to Azure. - :param value: Required. A list of Gallery Applications. - :type value: list[~azure.mgmt.compute.v2020_09_30.models.GalleryApplication] - :param next_link: The uri to fetch the next page of Application Definitions in the Application - Gallery. Call ListNext() with this to fetch the next page of gallery Application Definitions. + :param value: Required. A list of disk access resources. + :type value: list[~azure.mgmt.compute.v2020_09_30.models.DiskAccess] + :param next_link: The uri to fetch the next page of disk access resources. Call ListNext() with + this to fetch the next page of disk access resources. :type next_link: str """ @@ -401,47 +600,30 @@ class GalleryApplicationList(msrest.serialization.Model): } _attribute_map = { - 'value': {'key': 'value', 'type': '[GalleryApplication]'}, + 'value': {'key': 'value', 'type': '[DiskAccess]'}, 'next_link': {'key': 'nextLink', 'type': 'str'}, } def __init__( self, *, - value: List["GalleryApplication"], + value: List["DiskAccess"], next_link: Optional[str] = None, **kwargs ): - super(GalleryApplicationList, self).__init__(**kwargs) + super(DiskAccessList, self).__init__(**kwargs) self.value = value self.next_link = next_link -class UpdateResourceDefinition(msrest.serialization.Model): - """The Update Resource model definition. - - Variables are only populated by the server, and will be ignored when sending a request. +class DiskAccessUpdate(msrest.serialization.Model): + """Used for updating a disk access resource. - :ivar id: Resource Id. - :vartype id: str - :ivar name: Resource name. - :vartype name: str - :ivar type: Resource type. - :vartype type: str :param tags: A set of tags. Resource tags. :type tags: dict[str, str] """ - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - } - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, 'tags': {'key': 'tags', 'type': '{str}'}, } @@ -451,310 +633,219 @@ def __init__( tags: Optional[Dict[str, str]] = None, **kwargs ): - super(UpdateResourceDefinition, self).__init__(**kwargs) - self.id = None - self.name = None - self.type = None + super(DiskAccessUpdate, self).__init__(**kwargs) self.tags = tags -class GalleryApplicationUpdate(UpdateResourceDefinition): - """Specifies information about the gallery Application Definition that you want to update. +class DiskEncryptionSet(Resource): + """disk encryption set resource. 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: Resource Id. :vartype id: str :ivar name: Resource name. :vartype name: str :ivar type: Resource type. :vartype type: str + :param location: Required. Resource location. + :type location: str :param tags: A set of tags. Resource tags. :type tags: dict[str, str] - :param description: The description of this gallery Application Definition resource. This - property is updatable. - :type description: str - :param eula: The Eula agreement for the gallery Application Definition. - :type eula: str - :param privacy_statement_uri: The privacy statement uri. - :type privacy_statement_uri: str - :param release_note_uri: The release note uri. - :type release_note_uri: str - :param end_of_life_date: The end of life date of the gallery Application Definition. This - property can be used for decommissioning purposes. This property is updatable. - :type end_of_life_date: ~datetime.datetime - :param supported_os_type: This property allows you to specify the supported type of the OS that - application is built for. :code:`
`:code:`
` Possible values are: - :code:`
`:code:`
` **Windows** :code:`
`:code:`
` **Linux**. Possible values - include: "Windows", "Linux". - :type supported_os_type: str or ~azure.mgmt.compute.v2020_09_30.models.OperatingSystemTypes + :param identity: The managed identity for the disk encryption set. It should be given + permission on the key vault before it can be used to encrypt disks. + :type identity: ~azure.mgmt.compute.v2020_09_30.models.EncryptionSetIdentity + :param encryption_type: The type of key used to encrypt the data of the disk. Possible values + include: "EncryptionAtRestWithCustomerKey", "EncryptionAtRestWithPlatformAndCustomerKeys". + :type encryption_type: str or ~azure.mgmt.compute.v2020_09_30.models.DiskEncryptionSetType + :param active_key: The key vault key which is currently used by this disk encryption set. + :type active_key: ~azure.mgmt.compute.v2020_09_30.models.KeyForDiskEncryptionSet + :ivar previous_keys: A readonly collection of key vault keys previously used by this disk + encryption set while a key rotation is in progress. It will be empty if there is no ongoing key + rotation. + :vartype previous_keys: list[~azure.mgmt.compute.v2020_09_30.models.KeyForDiskEncryptionSet] + :ivar provisioning_state: The disk encryption set provisioning state. + :vartype provisioning_state: str """ _validation = { 'id': {'readonly': True}, 'name': {'readonly': True}, 'type': {'readonly': True}, + 'location': {'required': True}, + 'previous_keys': {'readonly': True}, + 'provisioning_state': {'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}'}, - 'description': {'key': 'properties.description', 'type': 'str'}, - 'eula': {'key': 'properties.eula', 'type': 'str'}, - 'privacy_statement_uri': {'key': 'properties.privacyStatementUri', 'type': 'str'}, - 'release_note_uri': {'key': 'properties.releaseNoteUri', 'type': 'str'}, - 'end_of_life_date': {'key': 'properties.endOfLifeDate', 'type': 'iso-8601'}, - 'supported_os_type': {'key': 'properties.supportedOSType', 'type': 'str'}, + 'identity': {'key': 'identity', 'type': 'EncryptionSetIdentity'}, + 'encryption_type': {'key': 'properties.encryptionType', 'type': 'str'}, + 'active_key': {'key': 'properties.activeKey', 'type': 'KeyForDiskEncryptionSet'}, + 'previous_keys': {'key': 'properties.previousKeys', 'type': '[KeyForDiskEncryptionSet]'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, } def __init__( self, *, + location: str, tags: Optional[Dict[str, str]] = None, - description: Optional[str] = None, - eula: Optional[str] = None, - privacy_statement_uri: Optional[str] = None, - release_note_uri: Optional[str] = None, - end_of_life_date: Optional[datetime.datetime] = None, - supported_os_type: Optional[Union[str, "OperatingSystemTypes"]] = None, + identity: Optional["EncryptionSetIdentity"] = None, + encryption_type: Optional[Union[str, "DiskEncryptionSetType"]] = None, + active_key: Optional["KeyForDiskEncryptionSet"] = None, **kwargs ): - super(GalleryApplicationUpdate, self).__init__(tags=tags, **kwargs) - self.description = description - self.eula = eula - self.privacy_statement_uri = privacy_statement_uri - self.release_note_uri = release_note_uri - self.end_of_life_date = end_of_life_date - self.supported_os_type = supported_os_type - + super(DiskEncryptionSet, self).__init__(location=location, tags=tags, **kwargs) + self.identity = identity + self.encryption_type = encryption_type + self.active_key = active_key + self.previous_keys = None + self.provisioning_state = None -class GalleryApplicationVersion(Resource): - """Specifies information about the gallery Application Version that you want to create or update. - Variables are only populated by the server, and will be ignored when sending a request. +class DiskEncryptionSetList(msrest.serialization.Model): + """The List disk encryption set operation response. All required parameters must be populated in order to send to Azure. - :ivar id: Resource Id. - :vartype id: str - :ivar name: Resource name. - :vartype name: str - :ivar type: Resource type. - :vartype type: str - :param location: Required. Resource location. - :type location: str - :param tags: A set of tags. Resource tags. - :type tags: dict[str, str] - :param publishing_profile: The publishing profile of a gallery image version. - :type publishing_profile: - ~azure.mgmt.compute.v2020_09_30.models.GalleryApplicationVersionPublishingProfile - :ivar provisioning_state: The provisioning state, which only appears in the response. Possible - values include: "Creating", "Updating", "Failed", "Succeeded", "Deleting", "Migrating". - :vartype provisioning_state: str or - ~azure.mgmt.compute.v2020_09_30.models.GalleryApplicationVersionPropertiesProvisioningState - :ivar replication_status: This is the replication status of the gallery image version. - :vartype replication_status: ~azure.mgmt.compute.v2020_09_30.models.ReplicationStatus + :param value: Required. A list of disk encryption sets. + :type value: list[~azure.mgmt.compute.v2020_09_30.models.DiskEncryptionSet] + :param next_link: The uri to fetch the next page of disk encryption sets. Call ListNext() with + this to fetch the next page of disk encryption sets. + :type next_link: str """ _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'location': {'required': True}, - 'provisioning_state': {'readonly': True}, - 'replication_status': {'readonly': True}, + 'value': {'required': 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}'}, - 'publishing_profile': {'key': 'properties.publishingProfile', 'type': 'GalleryApplicationVersionPublishingProfile'}, - 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, - 'replication_status': {'key': 'properties.replicationStatus', 'type': 'ReplicationStatus'}, + 'value': {'key': 'value', 'type': '[DiskEncryptionSet]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, } def __init__( self, *, - location: str, - tags: Optional[Dict[str, str]] = None, - publishing_profile: Optional["GalleryApplicationVersionPublishingProfile"] = None, + value: List["DiskEncryptionSet"], + next_link: Optional[str] = None, **kwargs ): - super(GalleryApplicationVersion, self).__init__(location=location, tags=tags, **kwargs) - self.publishing_profile = publishing_profile - self.provisioning_state = None - self.replication_status = None - + super(DiskEncryptionSetList, self).__init__(**kwargs) + self.value = value + self.next_link = next_link -class GalleryApplicationVersionList(msrest.serialization.Model): - """The List Gallery Application version operation response. - All required parameters must be populated in order to send to Azure. +class DiskEncryptionSetUpdate(msrest.serialization.Model): + """disk encryption set update resource. - :param value: Required. A list of gallery Application Versions. - :type value: list[~azure.mgmt.compute.v2020_09_30.models.GalleryApplicationVersion] - :param next_link: The uri to fetch the next page of gallery Application Versions. Call - ListNext() with this to fetch the next page of gallery Application Versions. - :type next_link: str + :param tags: A set of tags. Resource tags. + :type tags: dict[str, str] + :param encryption_type: The type of key used to encrypt the data of the disk. Possible values + include: "EncryptionAtRestWithCustomerKey", "EncryptionAtRestWithPlatformAndCustomerKeys". + :type encryption_type: str or ~azure.mgmt.compute.v2020_09_30.models.DiskEncryptionSetType + :param active_key: Key Vault Key Url to be used for server side encryption of Managed Disks and + Snapshots. + :type active_key: ~azure.mgmt.compute.v2020_09_30.models.KeyForDiskEncryptionSet """ - _validation = { - 'value': {'required': True}, - } - _attribute_map = { - 'value': {'key': 'value', 'type': '[GalleryApplicationVersion]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'encryption_type': {'key': 'properties.encryptionType', 'type': 'str'}, + 'active_key': {'key': 'properties.activeKey', 'type': 'KeyForDiskEncryptionSet'}, } def __init__( self, *, - value: List["GalleryApplicationVersion"], - next_link: Optional[str] = None, + tags: Optional[Dict[str, str]] = None, + encryption_type: Optional[Union[str, "DiskEncryptionSetType"]] = None, + active_key: Optional["KeyForDiskEncryptionSet"] = None, **kwargs ): - super(GalleryApplicationVersionList, self).__init__(**kwargs) - self.value = value - self.next_link = next_link + super(DiskEncryptionSetUpdate, self).__init__(**kwargs) + self.tags = tags + self.encryption_type = encryption_type + self.active_key = active_key -class GalleryArtifactPublishingProfileBase(msrest.serialization.Model): - """Describes the basic gallery artifact publishing profile. +class DiskList(msrest.serialization.Model): + """The List Disks operation response. - 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. - :param target_regions: The target regions where the Image Version is going to be replicated to. - This property is updatable. - :type target_regions: list[~azure.mgmt.compute.v2020_09_30.models.TargetRegion] - :param replica_count: The number of replicas of the Image Version to be created per region. - This property would take effect for a region when regionalReplicaCount is not specified. This - property is updatable. - :type replica_count: int - :param exclude_from_latest: If set to true, Virtual Machines deployed from the latest version - of the Image Definition won't use this Image Version. - :type exclude_from_latest: bool - :ivar published_date: The timestamp for when the gallery image version is published. - :vartype published_date: ~datetime.datetime - :param end_of_life_date: The end of life date of the gallery image version. This property can - be used for decommissioning purposes. This property is updatable. - :type end_of_life_date: ~datetime.datetime - :param storage_account_type: Specifies the storage account type to be used to store the image. - This property is not updatable. Possible values include: "Standard_LRS", "Standard_ZRS", - "Premium_LRS". - :type storage_account_type: str or ~azure.mgmt.compute.v2020_09_30.models.StorageAccountType + :param value: Required. A list of disks. + :type value: list[~azure.mgmt.compute.v2020_09_30.models.Disk] + :param next_link: The uri to fetch the next page of disks. Call ListNext() with this to fetch + the next page of disks. + :type next_link: str """ _validation = { - 'published_date': {'readonly': True}, + 'value': {'required': True}, } _attribute_map = { - 'target_regions': {'key': 'targetRegions', 'type': '[TargetRegion]'}, - 'replica_count': {'key': 'replicaCount', 'type': 'int'}, - 'exclude_from_latest': {'key': 'excludeFromLatest', 'type': 'bool'}, - 'published_date': {'key': 'publishedDate', 'type': 'iso-8601'}, - 'end_of_life_date': {'key': 'endOfLifeDate', 'type': 'iso-8601'}, - 'storage_account_type': {'key': 'storageAccountType', 'type': 'str'}, + 'value': {'key': 'value', 'type': '[Disk]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, } def __init__( self, *, - target_regions: Optional[List["TargetRegion"]] = None, - replica_count: Optional[int] = None, - exclude_from_latest: Optional[bool] = None, - end_of_life_date: Optional[datetime.datetime] = None, - storage_account_type: Optional[Union[str, "StorageAccountType"]] = None, + value: List["Disk"], + next_link: Optional[str] = None, **kwargs ): - super(GalleryArtifactPublishingProfileBase, self).__init__(**kwargs) - self.target_regions = target_regions - self.replica_count = replica_count - self.exclude_from_latest = exclude_from_latest - self.published_date = None - self.end_of_life_date = end_of_life_date - self.storage_account_type = storage_account_type + super(DiskList, self).__init__(**kwargs) + self.value = value + self.next_link = next_link -class GalleryApplicationVersionPublishingProfile(GalleryArtifactPublishingProfileBase): - """The publishing profile of a gallery image version. +class ProxyOnlyResource(msrest.serialization.Model): + """The ProxyOnly Resource model definition. 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. - - :param target_regions: The target regions where the Image Version is going to be replicated to. - This property is updatable. - :type target_regions: list[~azure.mgmt.compute.v2020_09_30.models.TargetRegion] - :param replica_count: The number of replicas of the Image Version to be created per region. - This property would take effect for a region when regionalReplicaCount is not specified. This - property is updatable. - :type replica_count: int - :param exclude_from_latest: If set to true, Virtual Machines deployed from the latest version - of the Image Definition won't use this Image Version. - :type exclude_from_latest: bool - :ivar published_date: The timestamp for when the gallery image version is published. - :vartype published_date: ~datetime.datetime - :param end_of_life_date: The end of life date of the gallery image version. This property can - be used for decommissioning purposes. This property is updatable. - :type end_of_life_date: ~datetime.datetime - :param storage_account_type: Specifies the storage account type to be used to store the image. - This property is not updatable. Possible values include: "Standard_LRS", "Standard_ZRS", - "Premium_LRS". - :type storage_account_type: str or ~azure.mgmt.compute.v2020_09_30.models.StorageAccountType - :param source: Required. The source image from which the Image Version is going to be created. - :type source: ~azure.mgmt.compute.v2020_09_30.models.UserArtifactSource - :param manage_actions: - :type manage_actions: ~azure.mgmt.compute.v2020_09_30.models.UserArtifactManage - :param enable_health_check: Optional. Whether or not this application reports health. - :type enable_health_check: bool + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str """ _validation = { - 'published_date': {'readonly': True}, - 'source': {'required': True}, + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, } _attribute_map = { - 'target_regions': {'key': 'targetRegions', 'type': '[TargetRegion]'}, - 'replica_count': {'key': 'replicaCount', 'type': 'int'}, - 'exclude_from_latest': {'key': 'excludeFromLatest', 'type': 'bool'}, - 'published_date': {'key': 'publishedDate', 'type': 'iso-8601'}, - 'end_of_life_date': {'key': 'endOfLifeDate', 'type': 'iso-8601'}, - 'storage_account_type': {'key': 'storageAccountType', 'type': 'str'}, - 'source': {'key': 'source', 'type': 'UserArtifactSource'}, - 'manage_actions': {'key': 'manageActions', 'type': 'UserArtifactManage'}, - 'enable_health_check': {'key': 'enableHealthCheck', 'type': 'bool'}, + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, } def __init__( self, - *, - source: "UserArtifactSource", - target_regions: Optional[List["TargetRegion"]] = None, - replica_count: Optional[int] = None, - exclude_from_latest: Optional[bool] = None, - end_of_life_date: Optional[datetime.datetime] = None, - storage_account_type: Optional[Union[str, "StorageAccountType"]] = None, - manage_actions: Optional["UserArtifactManage"] = None, - enable_health_check: Optional[bool] = None, **kwargs ): - super(GalleryApplicationVersionPublishingProfile, self).__init__(target_regions=target_regions, replica_count=replica_count, exclude_from_latest=exclude_from_latest, end_of_life_date=end_of_life_date, storage_account_type=storage_account_type, **kwargs) - self.source = source - self.manage_actions = manage_actions - self.enable_health_check = enable_health_check + super(ProxyOnlyResource, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None -class GalleryApplicationVersionUpdate(UpdateResourceDefinition): - """Specifies information about the gallery Application Version that you want to update. +class DiskRestorePoint(ProxyOnlyResource): + """Properties of disk restore point. Variables are only populated by the server, and will be ignored when sending a request. @@ -764,214 +855,513 @@ class GalleryApplicationVersionUpdate(UpdateResourceDefinition): :vartype name: str :ivar type: Resource type. :vartype type: str - :param tags: A set of tags. Resource tags. - :type tags: dict[str, str] - :param publishing_profile: The publishing profile of a gallery image version. - :type publishing_profile: - ~azure.mgmt.compute.v2020_09_30.models.GalleryApplicationVersionPublishingProfile - :ivar provisioning_state: The provisioning state, which only appears in the response. Possible - values include: "Creating", "Updating", "Failed", "Succeeded", "Deleting", "Migrating". - :vartype provisioning_state: str or - ~azure.mgmt.compute.v2020_09_30.models.GalleryApplicationVersionPropertiesProvisioningState - :ivar replication_status: This is the replication status of the gallery image version. - :vartype replication_status: ~azure.mgmt.compute.v2020_09_30.models.ReplicationStatus + :ivar time_created: The timestamp of restorePoint creation. + :vartype time_created: ~datetime.datetime + :ivar source_resource_id: arm id of source disk. + :vartype source_resource_id: str + :ivar os_type: The Operating System type. Possible values include: "Windows", "Linux". + :vartype os_type: str or ~azure.mgmt.compute.v2020_09_30.models.OperatingSystemTypes + :param hyper_v_generation: The hypervisor generation of the Virtual Machine. Applicable to OS + disks only. Possible values include: "V1", "V2". + :type hyper_v_generation: str or ~azure.mgmt.compute.v2020_09_30.models.HyperVGeneration + :param purchase_plan: Purchase plan information for the the image from which the OS disk was + created. + :type purchase_plan: ~azure.mgmt.compute.v2020_09_30.models.PurchasePlan + :ivar family_id: id of the backing snapshot's MIS family. + :vartype family_id: str + :ivar source_unique_id: unique incarnation id of the source disk. + :vartype source_unique_id: str + :ivar encryption: Encryption property can be used to encrypt data at rest with customer managed + keys or platform managed keys. + :vartype encryption: ~azure.mgmt.compute.v2020_09_30.models.Encryption """ _validation = { 'id': {'readonly': True}, 'name': {'readonly': True}, 'type': {'readonly': True}, - 'provisioning_state': {'readonly': True}, - 'replication_status': {'readonly': True}, + 'time_created': {'readonly': True}, + 'source_resource_id': {'readonly': True}, + 'os_type': {'readonly': True}, + 'family_id': {'readonly': True}, + 'source_unique_id': {'readonly': True}, + 'encryption': {'readonly': True}, } _attribute_map = { 'id': {'key': 'id', 'type': 'str'}, 'name': {'key': 'name', 'type': 'str'}, 'type': {'key': 'type', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'publishing_profile': {'key': 'properties.publishingProfile', 'type': 'GalleryApplicationVersionPublishingProfile'}, - 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, - 'replication_status': {'key': 'properties.replicationStatus', 'type': 'ReplicationStatus'}, + 'time_created': {'key': 'properties.timeCreated', 'type': 'iso-8601'}, + 'source_resource_id': {'key': 'properties.sourceResourceId', 'type': 'str'}, + 'os_type': {'key': 'properties.osType', 'type': 'str'}, + 'hyper_v_generation': {'key': 'properties.hyperVGeneration', 'type': 'str'}, + 'purchase_plan': {'key': 'properties.purchasePlan', 'type': 'PurchasePlan'}, + 'family_id': {'key': 'properties.familyId', 'type': 'str'}, + 'source_unique_id': {'key': 'properties.sourceUniqueId', 'type': 'str'}, + 'encryption': {'key': 'properties.encryption', 'type': 'Encryption'}, } def __init__( self, *, - tags: Optional[Dict[str, str]] = None, - publishing_profile: Optional["GalleryApplicationVersionPublishingProfile"] = None, + hyper_v_generation: Optional[Union[str, "HyperVGeneration"]] = None, + purchase_plan: Optional["PurchasePlan"] = None, **kwargs ): - super(GalleryApplicationVersionUpdate, self).__init__(tags=tags, **kwargs) - self.publishing_profile = publishing_profile - self.provisioning_state = None - self.replication_status = None + super(DiskRestorePoint, self).__init__(**kwargs) + self.time_created = None + self.source_resource_id = None + self.os_type = None + self.hyper_v_generation = hyper_v_generation + self.purchase_plan = purchase_plan + self.family_id = None + self.source_unique_id = None + self.encryption = None -class GalleryArtifactSource(msrest.serialization.Model): - """The source image from which the Image Version is going to be created. +class DiskRestorePointList(msrest.serialization.Model): + """The List Disk Restore Points operation response. All required parameters must be populated in order to send to Azure. - :param managed_image: Required. The managed artifact. - :type managed_image: ~azure.mgmt.compute.v2020_09_30.models.ManagedArtifact + :param value: Required. A list of disk restore points. + :type value: list[~azure.mgmt.compute.v2020_09_30.models.DiskRestorePoint] + :param next_link: The uri to fetch the next page of disk restore points. Call ListNext() with + this to fetch the next page of disk restore points. + :type next_link: str """ _validation = { - 'managed_image': {'required': True}, + 'value': {'required': True}, } _attribute_map = { - 'managed_image': {'key': 'managedImage', 'type': 'ManagedArtifact'}, + 'value': {'key': 'value', 'type': '[DiskRestorePoint]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, } def __init__( self, *, - managed_image: "ManagedArtifact", + value: List["DiskRestorePoint"], + next_link: Optional[str] = None, **kwargs ): - super(GalleryArtifactSource, self).__init__(**kwargs) - self.managed_image = managed_image + super(DiskRestorePointList, self).__init__(**kwargs) + self.value = value + self.next_link = next_link -class GalleryArtifactVersionSource(msrest.serialization.Model): - """The gallery artifact version source. +class DiskSku(msrest.serialization.Model): + """The disks sku name. Can be Standard_LRS, Premium_LRS, StandardSSD_LRS, or UltraSSD_LRS. - :param id: The id of the gallery artifact version source. Can specify a disk uri, snapshot uri, - user image or storage account resource. - :type id: str - :param uri: The uri of the gallery artifact version source. Currently used to specify vhd/blob - source. - :type uri: str + Variables are only populated by the server, and will be ignored when sending a request. + + :param name: The sku name. Possible values include: "Standard_LRS", "Premium_LRS", + "StandardSSD_LRS", "UltraSSD_LRS". + :type name: str or ~azure.mgmt.compute.v2020_09_30.models.DiskStorageAccountTypes + :ivar tier: The sku tier. + :vartype tier: str """ + _validation = { + 'tier': {'readonly': True}, + } + _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'uri': {'key': 'uri', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'tier': {'key': 'tier', 'type': 'str'}, } def __init__( self, *, - id: Optional[str] = None, - uri: Optional[str] = None, + name: Optional[Union[str, "DiskStorageAccountTypes"]] = None, **kwargs ): - super(GalleryArtifactVersionSource, self).__init__(**kwargs) - self.id = id - self.uri = uri - + super(DiskSku, self).__init__(**kwargs) + self.name = name + self.tier = None -class GalleryDiskImage(msrest.serialization.Model): - """This is the disk image base class. - Variables are only populated by the server, and will be ignored when sending a request. +class DiskUpdate(msrest.serialization.Model): + """Disk update resource. - :ivar size_in_gb: This property indicates the size of the VHD to be created. - :vartype size_in_gb: int - :param host_caching: The host caching of the disk. Valid values are 'None', 'ReadOnly', and - 'ReadWrite'. Possible values include: "None", "ReadOnly", "ReadWrite". - :type host_caching: str or ~azure.mgmt.compute.v2020_09_30.models.HostCaching - :param source: The gallery artifact version source. - :type source: ~azure.mgmt.compute.v2020_09_30.models.GalleryArtifactVersionSource + :param tags: A set of tags. Resource tags. + :type tags: dict[str, str] + :param sku: The disks sku name. Can be Standard_LRS, Premium_LRS, StandardSSD_LRS, or + UltraSSD_LRS. + :type sku: ~azure.mgmt.compute.v2020_09_30.models.DiskSku + :param os_type: the Operating System type. Possible values include: "Windows", "Linux". + :type os_type: str or ~azure.mgmt.compute.v2020_09_30.models.OperatingSystemTypes + :param disk_size_gb: If creationData.createOption is Empty, this field is mandatory and it + indicates the size of the disk to create. If this field is present for updates or creation with + other options, it indicates a resize. Resizes are only allowed if the disk is not attached to a + running VM, and can only increase the disk's size. + :type disk_size_gb: int + :param encryption_settings_collection: Encryption settings collection used be Azure Disk + Encryption, can contain multiple encryption settings per disk or snapshot. + :type encryption_settings_collection: + ~azure.mgmt.compute.v2020_09_30.models.EncryptionSettingsCollection + :param disk_iops_read_write: The number of IOPS allowed for this disk; only settable for + UltraSSD disks. One operation can transfer between 4k and 256k bytes. + :type disk_iops_read_write: long + :param disk_m_bps_read_write: The bandwidth allowed for this disk; only settable for UltraSSD + disks. MBps means millions of bytes per second - MB here uses the ISO notation, of powers of + 10. + :type disk_m_bps_read_write: long + :param disk_iops_read_only: The total number of IOPS that will be allowed across all VMs + mounting the shared disk as ReadOnly. One operation can transfer between 4k and 256k bytes. + :type disk_iops_read_only: long + :param disk_m_bps_read_only: The total throughput (MBps) that will be allowed across all VMs + mounting the shared disk as ReadOnly. MBps means millions of bytes per second - MB here uses + the ISO notation, of powers of 10. + :type disk_m_bps_read_only: long + :param max_shares: The maximum number of VMs that can attach to the disk at the same time. + Value greater than one indicates a disk that can be mounted on multiple VMs at the same time. + :type max_shares: int + :param encryption: Encryption property can be used to encrypt data at rest with customer + managed keys or platform managed keys. + :type encryption: ~azure.mgmt.compute.v2020_09_30.models.Encryption + :param network_access_policy: Policy for accessing the disk via network. Possible values + include: "AllowAll", "AllowPrivate", "DenyAll". + :type network_access_policy: str or ~azure.mgmt.compute.v2020_09_30.models.NetworkAccessPolicy + :param disk_access_id: ARM id of the DiskAccess resource for using private endpoints on disks. + :type disk_access_id: str + :param tier: Performance tier of the disk (e.g, P4, S10) as described here: + https://azure.microsoft.com/en-us/pricing/details/managed-disks/. Does not apply to Ultra + disks. + :type tier: str + :param bursting_enabled: Set to true to enable bursting beyond the provisioned performance + target of the disk. Bursting is disabled by default. Does not apply to Ultra disks. + :type bursting_enabled: bool + :param purchase_plan: Purchase plan information to be added on the OS disk. + :type purchase_plan: ~azure.mgmt.compute.v2020_09_30.models.PurchasePlan """ - _validation = { - 'size_in_gb': {'readonly': True}, - } - _attribute_map = { - 'size_in_gb': {'key': 'sizeInGB', 'type': 'int'}, - 'host_caching': {'key': 'hostCaching', 'type': 'str'}, - 'source': {'key': 'source', 'type': 'GalleryArtifactVersionSource'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'sku': {'key': 'sku', 'type': 'DiskSku'}, + 'os_type': {'key': 'properties.osType', 'type': 'str'}, + 'disk_size_gb': {'key': 'properties.diskSizeGB', 'type': 'int'}, + 'encryption_settings_collection': {'key': 'properties.encryptionSettingsCollection', 'type': 'EncryptionSettingsCollection'}, + 'disk_iops_read_write': {'key': 'properties.diskIOPSReadWrite', 'type': 'long'}, + 'disk_m_bps_read_write': {'key': 'properties.diskMBpsReadWrite', 'type': 'long'}, + 'disk_iops_read_only': {'key': 'properties.diskIOPSReadOnly', 'type': 'long'}, + 'disk_m_bps_read_only': {'key': 'properties.diskMBpsReadOnly', 'type': 'long'}, + 'max_shares': {'key': 'properties.maxShares', 'type': 'int'}, + 'encryption': {'key': 'properties.encryption', 'type': 'Encryption'}, + 'network_access_policy': {'key': 'properties.networkAccessPolicy', 'type': 'str'}, + 'disk_access_id': {'key': 'properties.diskAccessId', 'type': 'str'}, + 'tier': {'key': 'properties.tier', 'type': 'str'}, + 'bursting_enabled': {'key': 'properties.burstingEnabled', 'type': 'bool'}, + 'purchase_plan': {'key': 'properties.purchasePlan', 'type': 'PurchasePlan'}, } def __init__( self, *, - host_caching: Optional[Union[str, "HostCaching"]] = None, - source: Optional["GalleryArtifactVersionSource"] = None, + tags: Optional[Dict[str, str]] = None, + sku: Optional["DiskSku"] = None, + os_type: Optional[Union[str, "OperatingSystemTypes"]] = None, + disk_size_gb: Optional[int] = None, + encryption_settings_collection: Optional["EncryptionSettingsCollection"] = None, + disk_iops_read_write: Optional[int] = None, + disk_m_bps_read_write: Optional[int] = None, + disk_iops_read_only: Optional[int] = None, + disk_m_bps_read_only: Optional[int] = None, + max_shares: Optional[int] = None, + encryption: Optional["Encryption"] = None, + network_access_policy: Optional[Union[str, "NetworkAccessPolicy"]] = None, + disk_access_id: Optional[str] = None, + tier: Optional[str] = None, + bursting_enabled: Optional[bool] = None, + purchase_plan: Optional["PurchasePlan"] = None, **kwargs ): - super(GalleryDiskImage, self).__init__(**kwargs) - self.size_in_gb = None - self.host_caching = host_caching - self.source = source + super(DiskUpdate, self).__init__(**kwargs) + self.tags = tags + self.sku = sku + self.os_type = os_type + self.disk_size_gb = disk_size_gb + self.encryption_settings_collection = encryption_settings_collection + self.disk_iops_read_write = disk_iops_read_write + self.disk_m_bps_read_write = disk_m_bps_read_write + self.disk_iops_read_only = disk_iops_read_only + self.disk_m_bps_read_only = disk_m_bps_read_only + self.max_shares = max_shares + self.encryption = encryption + self.network_access_policy = network_access_policy + self.disk_access_id = disk_access_id + self.tier = tier + self.bursting_enabled = bursting_enabled + self.purchase_plan = purchase_plan -class GalleryDataDiskImage(GalleryDiskImage): - """This is the data disk image. +class Encryption(msrest.serialization.Model): + """Encryption at rest settings for disk or snapshot. + + :param disk_encryption_set_id: ResourceId of the disk encryption set to use for enabling + encryption at rest. + :type disk_encryption_set_id: str + :param type: The type of key used to encrypt the data of the disk. Possible values include: + "EncryptionAtRestWithPlatformKey", "EncryptionAtRestWithCustomerKey", + "EncryptionAtRestWithPlatformAndCustomerKeys". + :type type: str or ~azure.mgmt.compute.v2020_09_30.models.EncryptionType + """ + + _attribute_map = { + 'disk_encryption_set_id': {'key': 'diskEncryptionSetId', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__( + self, + *, + disk_encryption_set_id: Optional[str] = None, + type: Optional[Union[str, "EncryptionType"]] = None, + **kwargs + ): + super(Encryption, self).__init__(**kwargs) + self.disk_encryption_set_id = disk_encryption_set_id + self.type = type + + +class EncryptionImages(msrest.serialization.Model): + """Optional. Allows users to provide customer managed keys for encrypting the OS and data disks in the gallery artifact. + + :param os_disk_image: This is the disk image encryption base class. + :type os_disk_image: ~azure.mgmt.compute.v2020_09_30.models.DiskImageEncryption + :param data_disk_images: A list of encryption specifications for data disk images. + :type data_disk_images: list[~azure.mgmt.compute.v2020_09_30.models.DataDiskImageEncryption] + """ + + _attribute_map = { + 'os_disk_image': {'key': 'osDiskImage', 'type': 'DiskImageEncryption'}, + 'data_disk_images': {'key': 'dataDiskImages', 'type': '[DataDiskImageEncryption]'}, + } + + def __init__( + self, + *, + os_disk_image: Optional["DiskImageEncryption"] = None, + data_disk_images: Optional[List["DataDiskImageEncryption"]] = None, + **kwargs + ): + super(EncryptionImages, self).__init__(**kwargs) + self.os_disk_image = os_disk_image + self.data_disk_images = data_disk_images + + +class EncryptionSetIdentity(msrest.serialization.Model): + """The managed identity for the disk encryption set. It should be given permission on the key vault before it can be used to encrypt disks. Variables are only populated by the server, and will be ignored when sending a request. + :param type: The type of Managed Identity used by the DiskEncryptionSet. Only SystemAssigned is + supported for new creations. Disk Encryption Sets can be updated with Identity type None during + migration of subscription to a new Azure Active Directory tenant; it will cause the encrypted + resources to lose access to the keys. Possible values include: "SystemAssigned", "None". + :type type: str or ~azure.mgmt.compute.v2020_09_30.models.DiskEncryptionSetIdentityType + :ivar principal_id: The object id of the Managed Identity Resource. This will be sent to the RP + from ARM via the x-ms-identity-principal-id header in the PUT request if the resource has a + systemAssigned(implicit) identity. + :vartype principal_id: str + :ivar tenant_id: The tenant id of the Managed Identity Resource. This will be sent to the RP + from ARM via the x-ms-client-tenant-id header in the PUT request if the resource has a + systemAssigned(implicit) identity. + :vartype tenant_id: str + """ + + _validation = { + 'principal_id': {'readonly': True}, + 'tenant_id': {'readonly': True}, + } + + _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, + 'principal_id': {'key': 'principalId', 'type': 'str'}, + 'tenant_id': {'key': 'tenantId', 'type': 'str'}, + } + + def __init__( + self, + *, + type: Optional[Union[str, "DiskEncryptionSetIdentityType"]] = None, + **kwargs + ): + super(EncryptionSetIdentity, self).__init__(**kwargs) + self.type = type + self.principal_id = None + self.tenant_id = None + + +class EncryptionSettingsCollection(msrest.serialization.Model): + """Encryption settings for disk or snapshot. + All required parameters must be populated in order to send to Azure. - :ivar size_in_gb: This property indicates the size of the VHD to be created. - :vartype size_in_gb: int - :param host_caching: The host caching of the disk. Valid values are 'None', 'ReadOnly', and - 'ReadWrite'. Possible values include: "None", "ReadOnly", "ReadWrite". - :type host_caching: str or ~azure.mgmt.compute.v2020_09_30.models.HostCaching - :param source: The gallery artifact version source. - :type source: ~azure.mgmt.compute.v2020_09_30.models.GalleryArtifactVersionSource - :param lun: Required. This property specifies the logical unit number of the data disk. This - value is used to identify data disks within the Virtual Machine and therefore must be unique - for each data disk attached to the Virtual Machine. - :type lun: int + :param enabled: Required. Set this flag to true and provide DiskEncryptionKey and optional + KeyEncryptionKey to enable encryption. Set this flag to false and remove DiskEncryptionKey and + KeyEncryptionKey to disable encryption. If EncryptionSettings is null in the request object, + the existing settings remain unchanged. + :type enabled: bool + :param encryption_settings: A collection of encryption settings, one for each disk volume. + :type encryption_settings: + list[~azure.mgmt.compute.v2020_09_30.models.EncryptionSettingsElement] + :param encryption_settings_version: Describes what type of encryption is used for the disks. + Once this field is set, it cannot be overwritten. '1.0' corresponds to Azure Disk Encryption + with AAD app.'1.1' corresponds to Azure Disk Encryption. + :type encryption_settings_version: str """ _validation = { - 'size_in_gb': {'readonly': True}, - 'lun': {'required': True}, + 'enabled': {'required': True}, } _attribute_map = { - 'size_in_gb': {'key': 'sizeInGB', 'type': 'int'}, - 'host_caching': {'key': 'hostCaching', 'type': 'str'}, - 'source': {'key': 'source', 'type': 'GalleryArtifactVersionSource'}, - 'lun': {'key': 'lun', 'type': 'int'}, + 'enabled': {'key': 'enabled', 'type': 'bool'}, + 'encryption_settings': {'key': 'encryptionSettings', 'type': '[EncryptionSettingsElement]'}, + 'encryption_settings_version': {'key': 'encryptionSettingsVersion', 'type': 'str'}, } def __init__( self, *, - lun: int, - host_caching: Optional[Union[str, "HostCaching"]] = None, - source: Optional["GalleryArtifactVersionSource"] = None, + enabled: bool, + encryption_settings: Optional[List["EncryptionSettingsElement"]] = None, + encryption_settings_version: Optional[str] = None, **kwargs ): - super(GalleryDataDiskImage, self).__init__(host_caching=host_caching, source=source, **kwargs) - self.lun = lun + super(EncryptionSettingsCollection, self).__init__(**kwargs) + self.enabled = enabled + self.encryption_settings = encryption_settings + self.encryption_settings_version = encryption_settings_version -class GalleryIdentifier(msrest.serialization.Model): - """Describes the gallery unique name. +class EncryptionSettingsElement(msrest.serialization.Model): + """Encryption settings for one disk volume. + + :param disk_encryption_key: Key Vault Secret Url and vault id of the disk encryption key. + :type disk_encryption_key: ~azure.mgmt.compute.v2020_09_30.models.KeyVaultAndSecretReference + :param key_encryption_key: Key Vault Key Url and vault id of the key encryption key. + KeyEncryptionKey is optional and when provided is used to unwrap the disk encryption key. + :type key_encryption_key: ~azure.mgmt.compute.v2020_09_30.models.KeyVaultAndKeyReference + """ + + _attribute_map = { + 'disk_encryption_key': {'key': 'diskEncryptionKey', 'type': 'KeyVaultAndSecretReference'}, + 'key_encryption_key': {'key': 'keyEncryptionKey', 'type': 'KeyVaultAndKeyReference'}, + } + + def __init__( + self, + *, + disk_encryption_key: Optional["KeyVaultAndSecretReference"] = None, + key_encryption_key: Optional["KeyVaultAndKeyReference"] = None, + **kwargs + ): + super(EncryptionSettingsElement, self).__init__(**kwargs) + self.disk_encryption_key = disk_encryption_key + self.key_encryption_key = key_encryption_key + + +class ExtendedLocation(msrest.serialization.Model): + """The complex type of the extended location. + + :param name: The name of the extended location. + :type name: str + :param type: The type of the extended location. Possible values include: "EdgeZone". + :type type: str or ~azure.mgmt.compute.v2020_09_30.models.ExtendedLocationTypes + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__( + self, + *, + name: Optional[str] = None, + type: Optional[Union[str, "ExtendedLocationTypes"]] = None, + **kwargs + ): + super(ExtendedLocation, self).__init__(**kwargs) + self.name = name + self.type = type + + +class Gallery(Resource): + """Specifies information about the Shared Image Gallery that you want to create or update. Variables are only populated by the server, and will be ignored when sending a request. - :ivar unique_name: The unique name of the Shared Image Gallery. This name is generated - automatically by Azure. - :vartype unique_name: str + All required parameters must be populated in order to send to Azure. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param location: Required. Resource location. + :type location: str + :param tags: A set of tags. Resource tags. + :type tags: dict[str, str] + :param description: The description of this Shared Image Gallery resource. This property is + updatable. + :type description: str + :param identifier: Describes the gallery unique name. + :type identifier: ~azure.mgmt.compute.v2020_09_30.models.GalleryIdentifier + :ivar provisioning_state: The provisioning state, which only appears in the response. Possible + values include: "Creating", "Updating", "Failed", "Succeeded", "Deleting", "Migrating". + :vartype provisioning_state: str or + ~azure.mgmt.compute.v2020_09_30.models.GalleryPropertiesProvisioningState + :param sharing_profile: Profile for gallery sharing to subscription or tenant. + :type sharing_profile: ~azure.mgmt.compute.v2020_09_30.models.SharingProfile """ _validation = { - 'unique_name': {'readonly': True}, + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': True}, + 'provisioning_state': {'readonly': True}, } _attribute_map = { - 'unique_name': {'key': 'uniqueName', 'type': 'str'}, + '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}'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + 'identifier': {'key': 'properties.identifier', 'type': 'GalleryIdentifier'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'sharing_profile': {'key': 'properties.sharingProfile', 'type': 'SharingProfile'}, } def __init__( self, + *, + location: str, + tags: Optional[Dict[str, str]] = None, + description: Optional[str] = None, + identifier: Optional["GalleryIdentifier"] = None, + sharing_profile: Optional["SharingProfile"] = None, **kwargs ): - super(GalleryIdentifier, self).__init__(**kwargs) - self.unique_name = None + super(Gallery, self).__init__(location=location, tags=tags, **kwargs) + self.description = description + self.identifier = identifier + self.provisioning_state = None + self.sharing_profile = sharing_profile -class GalleryImage(Resource): - """Specifies information about the gallery image definition that you want to create or update. +class GalleryApplication(Resource): + """Specifies information about the gallery Application Definition that you want to create or update. Variables are only populated by the server, and will be ignored when sending a request. @@ -987,46 +1377,23 @@ class GalleryImage(Resource): :type location: str :param tags: A set of tags. Resource tags. :type tags: dict[str, str] - :param description: The description of this gallery image definition resource. This property is - updatable. + :param description: The description of this gallery Application Definition resource. This + property is updatable. :type description: str - :param eula: The Eula agreement for the gallery image definition. + :param eula: The Eula agreement for the gallery Application Definition. :type eula: str :param privacy_statement_uri: The privacy statement uri. :type privacy_statement_uri: str :param release_note_uri: The release note uri. :type release_note_uri: str - :param os_type: This property allows you to specify the type of the OS that is included in the - disk when creating a VM from a managed image. :code:`
`:code:`
` Possible values are: + :param end_of_life_date: The end of life date of the gallery Application Definition. This + property can be used for decommissioning purposes. This property is updatable. + :type end_of_life_date: ~datetime.datetime + :param supported_os_type: This property allows you to specify the supported type of the OS that + application is built for. :code:`
`:code:`
` Possible values are: :code:`
`:code:`
` **Windows** :code:`
`:code:`
` **Linux**. Possible values include: "Windows", "Linux". - :type os_type: str or ~azure.mgmt.compute.v2020_09_30.models.OperatingSystemTypes - :param os_state: This property allows the user to specify whether the virtual machines created - under this image are 'Generalized' or 'Specialized'. Possible values include: "Generalized", - "Specialized". - :type os_state: str or ~azure.mgmt.compute.v2020_09_30.models.OperatingSystemStateTypes - :param hyper_v_generation: The hypervisor generation of the Virtual Machine. Applicable to OS - disks only. Possible values include: "V1", "V2". - :type hyper_v_generation: str or ~azure.mgmt.compute.v2020_09_30.models.HyperVGeneration - :param features: A list of gallery image features. - :type features: list[~azure.mgmt.compute.v2020_09_30.models.GalleryImageFeature] - :param end_of_life_date: The end of life date of the gallery image definition. This property - can be used for decommissioning purposes. This property is updatable. - :type end_of_life_date: ~datetime.datetime - :param identifier: This is the gallery image definition identifier. - :type identifier: ~azure.mgmt.compute.v2020_09_30.models.GalleryImageIdentifier - :param recommended: The properties describe the recommended machine configuration for this - Image Definition. These properties are updatable. - :type recommended: ~azure.mgmt.compute.v2020_09_30.models.RecommendedMachineConfiguration - :param disallowed: Describes the disallowed disk types. - :type disallowed: ~azure.mgmt.compute.v2020_09_30.models.Disallowed - :param purchase_plan: Describes the gallery image definition purchase plan. This is used by - marketplace images. - :type purchase_plan: ~azure.mgmt.compute.v2020_09_30.models.ImagePurchasePlan - :ivar provisioning_state: The provisioning state, which only appears in the response. Possible - values include: "Creating", "Updating", "Failed", "Succeeded", "Deleting", "Migrating". - :vartype provisioning_state: str or - ~azure.mgmt.compute.v2020_09_30.models.GalleryImagePropertiesProvisioningState + :type supported_os_type: str or ~azure.mgmt.compute.v2020_09_30.models.OperatingSystemTypes """ _validation = { @@ -1034,7 +1401,6 @@ class GalleryImage(Resource): 'name': {'readonly': True}, 'type': {'readonly': True}, 'location': {'required': True}, - 'provisioning_state': {'readonly': True}, } _attribute_map = { @@ -1047,16 +1413,8 @@ class GalleryImage(Resource): 'eula': {'key': 'properties.eula', 'type': 'str'}, 'privacy_statement_uri': {'key': 'properties.privacyStatementUri', 'type': 'str'}, 'release_note_uri': {'key': 'properties.releaseNoteUri', 'type': 'str'}, - 'os_type': {'key': 'properties.osType', 'type': 'str'}, - 'os_state': {'key': 'properties.osState', 'type': 'str'}, - 'hyper_v_generation': {'key': 'properties.hyperVGeneration', 'type': 'str'}, - 'features': {'key': 'properties.features', 'type': '[GalleryImageFeature]'}, 'end_of_life_date': {'key': 'properties.endOfLifeDate', 'type': 'iso-8601'}, - 'identifier': {'key': 'properties.identifier', 'type': 'GalleryImageIdentifier'}, - 'recommended': {'key': 'properties.recommended', 'type': 'RecommendedMachineConfiguration'}, - 'disallowed': {'key': 'properties.disallowed', 'type': 'Disallowed'}, - 'purchase_plan': {'key': 'properties.purchasePlan', 'type': 'ImagePurchasePlan'}, - 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'supported_os_type': {'key': 'properties.supportedOSType', 'type': 'str'}, } def __init__( @@ -1068,134 +1426,95 @@ def __init__( eula: Optional[str] = None, privacy_statement_uri: Optional[str] = None, release_note_uri: Optional[str] = None, - os_type: Optional[Union[str, "OperatingSystemTypes"]] = None, - os_state: Optional[Union[str, "OperatingSystemStateTypes"]] = None, - hyper_v_generation: Optional[Union[str, "HyperVGeneration"]] = None, - features: Optional[List["GalleryImageFeature"]] = None, end_of_life_date: Optional[datetime.datetime] = None, - identifier: Optional["GalleryImageIdentifier"] = None, - recommended: Optional["RecommendedMachineConfiguration"] = None, - disallowed: Optional["Disallowed"] = None, - purchase_plan: Optional["ImagePurchasePlan"] = None, + supported_os_type: Optional[Union[str, "OperatingSystemTypes"]] = None, **kwargs ): - super(GalleryImage, self).__init__(location=location, tags=tags, **kwargs) + super(GalleryApplication, self).__init__(location=location, tags=tags, **kwargs) self.description = description self.eula = eula self.privacy_statement_uri = privacy_statement_uri self.release_note_uri = release_note_uri - self.os_type = os_type - self.os_state = os_state - self.hyper_v_generation = hyper_v_generation - self.features = features self.end_of_life_date = end_of_life_date - self.identifier = identifier - self.recommended = recommended - self.disallowed = disallowed - self.purchase_plan = purchase_plan - self.provisioning_state = None - - -class GalleryImageFeature(msrest.serialization.Model): - """A feature for gallery image. - - :param name: The name of the gallery image feature. - :type name: str - :param value: The value of the gallery image feature. - :type value: str - """ - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'value': {'key': 'value', 'type': 'str'}, - } - - def __init__( - self, - *, - name: Optional[str] = None, - value: Optional[str] = None, - **kwargs - ): - super(GalleryImageFeature, self).__init__(**kwargs) - self.name = name - self.value = value + self.supported_os_type = supported_os_type -class GalleryImageIdentifier(msrest.serialization.Model): - """This is the gallery image definition identifier. +class GalleryApplicationList(msrest.serialization.Model): + """The List Gallery Applications operation response. All required parameters must be populated in order to send to Azure. - :param publisher: Required. The name of the gallery image definition publisher. - :type publisher: str - :param offer: Required. The name of the gallery image definition offer. - :type offer: str - :param sku: Required. The name of the gallery image definition SKU. - :type sku: str + :param value: Required. A list of Gallery Applications. + :type value: list[~azure.mgmt.compute.v2020_09_30.models.GalleryApplication] + :param next_link: The uri to fetch the next page of Application Definitions in the Application + Gallery. Call ListNext() with this to fetch the next page of gallery Application Definitions. + :type next_link: str """ _validation = { - 'publisher': {'required': True}, - 'offer': {'required': True}, - 'sku': {'required': True}, + 'value': {'required': True}, } _attribute_map = { - 'publisher': {'key': 'publisher', 'type': 'str'}, - 'offer': {'key': 'offer', 'type': 'str'}, - 'sku': {'key': 'sku', 'type': 'str'}, + 'value': {'key': 'value', 'type': '[GalleryApplication]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, } def __init__( self, *, - publisher: str, - offer: str, - sku: str, + value: List["GalleryApplication"], + next_link: Optional[str] = None, **kwargs ): - super(GalleryImageIdentifier, self).__init__(**kwargs) - self.publisher = publisher - self.offer = offer - self.sku = sku + super(GalleryApplicationList, self).__init__(**kwargs) + self.value = value + self.next_link = next_link -class GalleryImageList(msrest.serialization.Model): - """The List Gallery Images operation response. +class UpdateResourceDefinition(msrest.serialization.Model): + """The Update Resource model definition. - All required parameters must be populated in order to send to Azure. + Variables are only populated by the server, and will be ignored when sending a request. - :param value: Required. A list of Shared Image Gallery images. - :type value: list[~azure.mgmt.compute.v2020_09_30.models.GalleryImage] - :param next_link: The uri to fetch the next page of Image Definitions in the Shared Image - Gallery. Call ListNext() with this to fetch the next page of gallery image definitions. - :type next_link: str + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param tags: A set of tags. Resource tags. + :type tags: dict[str, str] """ _validation = { - 'value': {'required': True}, + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, } _attribute_map = { - 'value': {'key': 'value', 'type': '[GalleryImage]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, } def __init__( self, *, - value: List["GalleryImage"], - next_link: Optional[str] = None, + tags: Optional[Dict[str, str]] = None, **kwargs ): - super(GalleryImageList, self).__init__(**kwargs) - self.value = value - self.next_link = next_link + super(UpdateResourceDefinition, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None + self.tags = tags -class GalleryImageUpdate(UpdateResourceDefinition): - """Specifies information about the gallery image definition that you want to update. +class GalleryApplicationUpdate(UpdateResourceDefinition): + """Specifies information about the gallery Application Definition that you want to update. Variables are only populated by the server, and will be ignored when sending a request. @@ -1207,53 +1526,29 @@ class GalleryImageUpdate(UpdateResourceDefinition): :vartype type: str :param tags: A set of tags. Resource tags. :type tags: dict[str, str] - :param description: The description of this gallery image definition resource. This property is - updatable. + :param description: The description of this gallery Application Definition resource. This + property is updatable. :type description: str - :param eula: The Eula agreement for the gallery image definition. + :param eula: The Eula agreement for the gallery Application Definition. :type eula: str :param privacy_statement_uri: The privacy statement uri. :type privacy_statement_uri: str :param release_note_uri: The release note uri. :type release_note_uri: str - :param os_type: This property allows you to specify the type of the OS that is included in the - disk when creating a VM from a managed image. :code:`
`:code:`
` Possible values are: + :param end_of_life_date: The end of life date of the gallery Application Definition. This + property can be used for decommissioning purposes. This property is updatable. + :type end_of_life_date: ~datetime.datetime + :param supported_os_type: This property allows you to specify the supported type of the OS that + application is built for. :code:`
`:code:`
` Possible values are: :code:`
`:code:`
` **Windows** :code:`
`:code:`
` **Linux**. Possible values include: "Windows", "Linux". - :type os_type: str or ~azure.mgmt.compute.v2020_09_30.models.OperatingSystemTypes - :param os_state: This property allows the user to specify whether the virtual machines created - under this image are 'Generalized' or 'Specialized'. Possible values include: "Generalized", - "Specialized". - :type os_state: str or ~azure.mgmt.compute.v2020_09_30.models.OperatingSystemStateTypes - :param hyper_v_generation: The hypervisor generation of the Virtual Machine. Applicable to OS - disks only. Possible values include: "V1", "V2". - :type hyper_v_generation: str or ~azure.mgmt.compute.v2020_09_30.models.HyperVGeneration - :param features: A list of gallery image features. - :type features: list[~azure.mgmt.compute.v2020_09_30.models.GalleryImageFeature] - :param end_of_life_date: The end of life date of the gallery image definition. This property - can be used for decommissioning purposes. This property is updatable. - :type end_of_life_date: ~datetime.datetime - :param identifier: This is the gallery image definition identifier. - :type identifier: ~azure.mgmt.compute.v2020_09_30.models.GalleryImageIdentifier - :param recommended: The properties describe the recommended machine configuration for this - Image Definition. These properties are updatable. - :type recommended: ~azure.mgmt.compute.v2020_09_30.models.RecommendedMachineConfiguration - :param disallowed: Describes the disallowed disk types. - :type disallowed: ~azure.mgmt.compute.v2020_09_30.models.Disallowed - :param purchase_plan: Describes the gallery image definition purchase plan. This is used by - marketplace images. - :type purchase_plan: ~azure.mgmt.compute.v2020_09_30.models.ImagePurchasePlan - :ivar provisioning_state: The provisioning state, which only appears in the response. Possible - values include: "Creating", "Updating", "Failed", "Succeeded", "Deleting", "Migrating". - :vartype provisioning_state: str or - ~azure.mgmt.compute.v2020_09_30.models.GalleryImagePropertiesProvisioningState + :type supported_os_type: str or ~azure.mgmt.compute.v2020_09_30.models.OperatingSystemTypes """ _validation = { 'id': {'readonly': True}, 'name': {'readonly': True}, 'type': {'readonly': True}, - 'provisioning_state': {'readonly': True}, } _attribute_map = { @@ -1265,16 +1560,8 @@ class GalleryImageUpdate(UpdateResourceDefinition): 'eula': {'key': 'properties.eula', 'type': 'str'}, 'privacy_statement_uri': {'key': 'properties.privacyStatementUri', 'type': 'str'}, 'release_note_uri': {'key': 'properties.releaseNoteUri', 'type': 'str'}, - 'os_type': {'key': 'properties.osType', 'type': 'str'}, - 'os_state': {'key': 'properties.osState', 'type': 'str'}, - 'hyper_v_generation': {'key': 'properties.hyperVGeneration', 'type': 'str'}, - 'features': {'key': 'properties.features', 'type': '[GalleryImageFeature]'}, 'end_of_life_date': {'key': 'properties.endOfLifeDate', 'type': 'iso-8601'}, - 'identifier': {'key': 'properties.identifier', 'type': 'GalleryImageIdentifier'}, - 'recommended': {'key': 'properties.recommended', 'type': 'RecommendedMachineConfiguration'}, - 'disallowed': {'key': 'properties.disallowed', 'type': 'Disallowed'}, - 'purchase_plan': {'key': 'properties.purchasePlan', 'type': 'ImagePurchasePlan'}, - 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'supported_os_type': {'key': 'properties.supportedOSType', 'type': 'str'}, } def __init__( @@ -1285,36 +1572,21 @@ def __init__( eula: Optional[str] = None, privacy_statement_uri: Optional[str] = None, release_note_uri: Optional[str] = None, - os_type: Optional[Union[str, "OperatingSystemTypes"]] = None, - os_state: Optional[Union[str, "OperatingSystemStateTypes"]] = None, - hyper_v_generation: Optional[Union[str, "HyperVGeneration"]] = None, - features: Optional[List["GalleryImageFeature"]] = None, end_of_life_date: Optional[datetime.datetime] = None, - identifier: Optional["GalleryImageIdentifier"] = None, - recommended: Optional["RecommendedMachineConfiguration"] = None, - disallowed: Optional["Disallowed"] = None, - purchase_plan: Optional["ImagePurchasePlan"] = None, + supported_os_type: Optional[Union[str, "OperatingSystemTypes"]] = None, **kwargs ): - super(GalleryImageUpdate, self).__init__(tags=tags, **kwargs) + super(GalleryApplicationUpdate, self).__init__(tags=tags, **kwargs) self.description = description self.eula = eula self.privacy_statement_uri = privacy_statement_uri self.release_note_uri = release_note_uri - self.os_type = os_type - self.os_state = os_state - self.hyper_v_generation = hyper_v_generation - self.features = features self.end_of_life_date = end_of_life_date - self.identifier = identifier - self.recommended = recommended - self.disallowed = disallowed - self.purchase_plan = purchase_plan - self.provisioning_state = None + self.supported_os_type = supported_os_type -class GalleryImageVersion(Resource): - """Specifies information about the gallery image version that you want to create or update. +class GalleryApplicationVersion(Resource): + """Specifies information about the gallery Application Version that you want to create or update. Variables are only populated by the server, and will be ignored when sending a request. @@ -1330,15 +1602,13 @@ class GalleryImageVersion(Resource): :type location: str :param tags: A set of tags. Resource tags. :type tags: dict[str, str] - :param publishing_profile: Describes the basic gallery artifact publishing profile. + :param publishing_profile: The publishing profile of a gallery image version. :type publishing_profile: - ~azure.mgmt.compute.v2020_09_30.models.GalleryArtifactPublishingProfileBase + ~azure.mgmt.compute.v2020_09_30.models.GalleryApplicationVersionPublishingProfile :ivar provisioning_state: The provisioning state, which only appears in the response. Possible values include: "Creating", "Updating", "Failed", "Succeeded", "Deleting", "Migrating". :vartype provisioning_state: str or - ~azure.mgmt.compute.v2020_09_30.models.GalleryImageVersionPropertiesProvisioningState - :param storage_profile: This is the storage profile of a Gallery Image Version. - :type storage_profile: ~azure.mgmt.compute.v2020_09_30.models.GalleryImageVersionStorageProfile + ~azure.mgmt.compute.v2020_09_30.models.GalleryApplicationVersionPropertiesProvisioningState :ivar replication_status: This is the replication status of the gallery image version. :vartype replication_status: ~azure.mgmt.compute.v2020_09_30.models.ReplicationStatus """ @@ -1358,9 +1628,8 @@ class GalleryImageVersion(Resource): 'type': {'key': 'type', 'type': 'str'}, 'location': {'key': 'location', 'type': 'str'}, 'tags': {'key': 'tags', 'type': '{str}'}, - 'publishing_profile': {'key': 'properties.publishingProfile', 'type': 'GalleryArtifactPublishingProfileBase'}, + 'publishing_profile': {'key': 'properties.publishingProfile', 'type': 'GalleryApplicationVersionPublishingProfile'}, 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, - 'storage_profile': {'key': 'properties.storageProfile', 'type': 'GalleryImageVersionStorageProfile'}, 'replication_status': {'key': 'properties.replicationStatus', 'type': 'ReplicationStatus'}, } @@ -1369,26 +1638,24 @@ def __init__( *, location: str, tags: Optional[Dict[str, str]] = None, - publishing_profile: Optional["GalleryArtifactPublishingProfileBase"] = None, - storage_profile: Optional["GalleryImageVersionStorageProfile"] = None, + publishing_profile: Optional["GalleryApplicationVersionPublishingProfile"] = None, **kwargs ): - super(GalleryImageVersion, self).__init__(location=location, tags=tags, **kwargs) + super(GalleryApplicationVersion, self).__init__(location=location, tags=tags, **kwargs) self.publishing_profile = publishing_profile self.provisioning_state = None - self.storage_profile = storage_profile self.replication_status = None -class GalleryImageVersionList(msrest.serialization.Model): - """The List Gallery Image version operation response. +class GalleryApplicationVersionList(msrest.serialization.Model): + """The List Gallery Application version operation response. All required parameters must be populated in order to send to Azure. - :param value: Required. A list of gallery image versions. - :type value: list[~azure.mgmt.compute.v2020_09_30.models.GalleryImageVersion] - :param next_link: The uri to fetch the next page of gallery image versions. Call ListNext() - with this to fetch the next page of gallery image versions. + :param value: Required. A list of gallery Application Versions. + :type value: list[~azure.mgmt.compute.v2020_09_30.models.GalleryApplicationVersion] + :param next_link: The uri to fetch the next page of gallery Application Versions. Call + ListNext() with this to fetch the next page of gallery Application Versions. :type next_link: str """ @@ -1397,234 +1664,1443 @@ class GalleryImageVersionList(msrest.serialization.Model): } _attribute_map = { - 'value': {'key': 'value', 'type': '[GalleryImageVersion]'}, + 'value': {'key': 'value', 'type': '[GalleryApplicationVersion]'}, 'next_link': {'key': 'nextLink', 'type': 'str'}, } def __init__( self, *, - value: List["GalleryImageVersion"], + value: List["GalleryApplicationVersion"], next_link: Optional[str] = None, **kwargs ): - super(GalleryImageVersionList, self).__init__(**kwargs) + super(GalleryApplicationVersionList, self).__init__(**kwargs) self.value = value self.next_link = next_link -class GalleryImageVersionPublishingProfile(GalleryArtifactPublishingProfileBase): - """The publishing profile of a gallery image Version. +class GalleryArtifactPublishingProfileBase(msrest.serialization.Model): + """Describes the basic gallery artifact publishing profile. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param target_regions: The target regions where the Image Version is going to be replicated to. + This property is updatable. + :type target_regions: list[~azure.mgmt.compute.v2020_09_30.models.TargetRegion] + :param replica_count: The number of replicas of the Image Version to be created per region. + This property would take effect for a region when regionalReplicaCount is not specified. This + property is updatable. + :type replica_count: int + :param exclude_from_latest: If set to true, Virtual Machines deployed from the latest version + of the Image Definition won't use this Image Version. + :type exclude_from_latest: bool + :ivar published_date: The timestamp for when the gallery image version is published. + :vartype published_date: ~datetime.datetime + :param end_of_life_date: The end of life date of the gallery image version. This property can + be used for decommissioning purposes. This property is updatable. + :type end_of_life_date: ~datetime.datetime + :param storage_account_type: Specifies the storage account type to be used to store the image. + This property is not updatable. Possible values include: "Standard_LRS", "Standard_ZRS", + "Premium_LRS". + :type storage_account_type: str or ~azure.mgmt.compute.v2020_09_30.models.StorageAccountType + """ + + _validation = { + 'published_date': {'readonly': True}, + } + + _attribute_map = { + 'target_regions': {'key': 'targetRegions', 'type': '[TargetRegion]'}, + 'replica_count': {'key': 'replicaCount', 'type': 'int'}, + 'exclude_from_latest': {'key': 'excludeFromLatest', 'type': 'bool'}, + 'published_date': {'key': 'publishedDate', 'type': 'iso-8601'}, + 'end_of_life_date': {'key': 'endOfLifeDate', 'type': 'iso-8601'}, + 'storage_account_type': {'key': 'storageAccountType', 'type': 'str'}, + } + + def __init__( + self, + *, + target_regions: Optional[List["TargetRegion"]] = None, + replica_count: Optional[int] = None, + exclude_from_latest: Optional[bool] = None, + end_of_life_date: Optional[datetime.datetime] = None, + storage_account_type: Optional[Union[str, "StorageAccountType"]] = None, + **kwargs + ): + super(GalleryArtifactPublishingProfileBase, self).__init__(**kwargs) + self.target_regions = target_regions + self.replica_count = replica_count + self.exclude_from_latest = exclude_from_latest + self.published_date = None + self.end_of_life_date = end_of_life_date + self.storage_account_type = storage_account_type + + +class GalleryApplicationVersionPublishingProfile(GalleryArtifactPublishingProfileBase): + """The publishing profile of a gallery image version. + + 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. + + :param target_regions: The target regions where the Image Version is going to be replicated to. + This property is updatable. + :type target_regions: list[~azure.mgmt.compute.v2020_09_30.models.TargetRegion] + :param replica_count: The number of replicas of the Image Version to be created per region. + This property would take effect for a region when regionalReplicaCount is not specified. This + property is updatable. + :type replica_count: int + :param exclude_from_latest: If set to true, Virtual Machines deployed from the latest version + of the Image Definition won't use this Image Version. + :type exclude_from_latest: bool + :ivar published_date: The timestamp for when the gallery image version is published. + :vartype published_date: ~datetime.datetime + :param end_of_life_date: The end of life date of the gallery image version. This property can + be used for decommissioning purposes. This property is updatable. + :type end_of_life_date: ~datetime.datetime + :param storage_account_type: Specifies the storage account type to be used to store the image. + This property is not updatable. Possible values include: "Standard_LRS", "Standard_ZRS", + "Premium_LRS". + :type storage_account_type: str or ~azure.mgmt.compute.v2020_09_30.models.StorageAccountType + :param source: Required. The source image from which the Image Version is going to be created. + :type source: ~azure.mgmt.compute.v2020_09_30.models.UserArtifactSource + :param manage_actions: + :type manage_actions: ~azure.mgmt.compute.v2020_09_30.models.UserArtifactManage + :param enable_health_check: Optional. Whether or not this application reports health. + :type enable_health_check: bool + """ + + _validation = { + 'published_date': {'readonly': True}, + 'source': {'required': True}, + } + + _attribute_map = { + 'target_regions': {'key': 'targetRegions', 'type': '[TargetRegion]'}, + 'replica_count': {'key': 'replicaCount', 'type': 'int'}, + 'exclude_from_latest': {'key': 'excludeFromLatest', 'type': 'bool'}, + 'published_date': {'key': 'publishedDate', 'type': 'iso-8601'}, + 'end_of_life_date': {'key': 'endOfLifeDate', 'type': 'iso-8601'}, + 'storage_account_type': {'key': 'storageAccountType', 'type': 'str'}, + 'source': {'key': 'source', 'type': 'UserArtifactSource'}, + 'manage_actions': {'key': 'manageActions', 'type': 'UserArtifactManage'}, + 'enable_health_check': {'key': 'enableHealthCheck', 'type': 'bool'}, + } + + def __init__( + self, + *, + source: "UserArtifactSource", + target_regions: Optional[List["TargetRegion"]] = None, + replica_count: Optional[int] = None, + exclude_from_latest: Optional[bool] = None, + end_of_life_date: Optional[datetime.datetime] = None, + storage_account_type: Optional[Union[str, "StorageAccountType"]] = None, + manage_actions: Optional["UserArtifactManage"] = None, + enable_health_check: Optional[bool] = None, + **kwargs + ): + super(GalleryApplicationVersionPublishingProfile, self).__init__(target_regions=target_regions, replica_count=replica_count, exclude_from_latest=exclude_from_latest, end_of_life_date=end_of_life_date, storage_account_type=storage_account_type, **kwargs) + self.source = source + self.manage_actions = manage_actions + self.enable_health_check = enable_health_check + + +class GalleryApplicationVersionUpdate(UpdateResourceDefinition): + """Specifies information about the gallery Application Version that you want to update. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param tags: A set of tags. Resource tags. + :type tags: dict[str, str] + :param publishing_profile: The publishing profile of a gallery image version. + :type publishing_profile: + ~azure.mgmt.compute.v2020_09_30.models.GalleryApplicationVersionPublishingProfile + :ivar provisioning_state: The provisioning state, which only appears in the response. Possible + values include: "Creating", "Updating", "Failed", "Succeeded", "Deleting", "Migrating". + :vartype provisioning_state: str or + ~azure.mgmt.compute.v2020_09_30.models.GalleryApplicationVersionPropertiesProvisioningState + :ivar replication_status: This is the replication status of the gallery image version. + :vartype replication_status: ~azure.mgmt.compute.v2020_09_30.models.ReplicationStatus + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + 'replication_status': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'publishing_profile': {'key': 'properties.publishingProfile', 'type': 'GalleryApplicationVersionPublishingProfile'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'replication_status': {'key': 'properties.replicationStatus', 'type': 'ReplicationStatus'}, + } + + def __init__( + self, + *, + tags: Optional[Dict[str, str]] = None, + publishing_profile: Optional["GalleryApplicationVersionPublishingProfile"] = None, + **kwargs + ): + super(GalleryApplicationVersionUpdate, self).__init__(tags=tags, **kwargs) + self.publishing_profile = publishing_profile + self.provisioning_state = None + self.replication_status = None + + +class GalleryArtifactSource(msrest.serialization.Model): + """The source image from which the Image Version is going to be created. + + All required parameters must be populated in order to send to Azure. + + :param managed_image: Required. The managed artifact. + :type managed_image: ~azure.mgmt.compute.v2020_09_30.models.ManagedArtifact + """ + + _validation = { + 'managed_image': {'required': True}, + } + + _attribute_map = { + 'managed_image': {'key': 'managedImage', 'type': 'ManagedArtifact'}, + } + + def __init__( + self, + *, + managed_image: "ManagedArtifact", + **kwargs + ): + super(GalleryArtifactSource, self).__init__(**kwargs) + self.managed_image = managed_image + + +class GalleryArtifactVersionSource(msrest.serialization.Model): + """The gallery artifact version source. + + :param id: The id of the gallery artifact version source. Can specify a disk uri, snapshot uri, + user image or storage account resource. + :type id: str + :param uri: The uri of the gallery artifact version source. Currently used to specify vhd/blob + source. + :type uri: str + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'uri': {'key': 'uri', 'type': 'str'}, + } + + def __init__( + self, + *, + id: Optional[str] = None, + uri: Optional[str] = None, + **kwargs + ): + super(GalleryArtifactVersionSource, self).__init__(**kwargs) + self.id = id + self.uri = uri + + +class GalleryDiskImage(msrest.serialization.Model): + """This is the disk image base class. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar size_in_gb: This property indicates the size of the VHD to be created. + :vartype size_in_gb: int + :param host_caching: The host caching of the disk. Valid values are 'None', 'ReadOnly', and + 'ReadWrite'. Possible values include: "None", "ReadOnly", "ReadWrite". + :type host_caching: str or ~azure.mgmt.compute.v2020_09_30.models.HostCaching + :param source: The gallery artifact version source. + :type source: ~azure.mgmt.compute.v2020_09_30.models.GalleryArtifactVersionSource + """ + + _validation = { + 'size_in_gb': {'readonly': True}, + } + + _attribute_map = { + 'size_in_gb': {'key': 'sizeInGB', 'type': 'int'}, + 'host_caching': {'key': 'hostCaching', 'type': 'str'}, + 'source': {'key': 'source', 'type': 'GalleryArtifactVersionSource'}, + } + + def __init__( + self, + *, + host_caching: Optional[Union[str, "HostCaching"]] = None, + source: Optional["GalleryArtifactVersionSource"] = None, + **kwargs + ): + super(GalleryDiskImage, self).__init__(**kwargs) + self.size_in_gb = None + self.host_caching = host_caching + self.source = source + + +class GalleryDataDiskImage(GalleryDiskImage): + """This is the data disk image. + + 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 size_in_gb: This property indicates the size of the VHD to be created. + :vartype size_in_gb: int + :param host_caching: The host caching of the disk. Valid values are 'None', 'ReadOnly', and + 'ReadWrite'. Possible values include: "None", "ReadOnly", "ReadWrite". + :type host_caching: str or ~azure.mgmt.compute.v2020_09_30.models.HostCaching + :param source: The gallery artifact version source. + :type source: ~azure.mgmt.compute.v2020_09_30.models.GalleryArtifactVersionSource + :param lun: Required. This property specifies the logical unit number of the data disk. This + value is used to identify data disks within the Virtual Machine and therefore must be unique + for each data disk attached to the Virtual Machine. + :type lun: int + """ + + _validation = { + 'size_in_gb': {'readonly': True}, + 'lun': {'required': True}, + } + + _attribute_map = { + 'size_in_gb': {'key': 'sizeInGB', 'type': 'int'}, + 'host_caching': {'key': 'hostCaching', 'type': 'str'}, + 'source': {'key': 'source', 'type': 'GalleryArtifactVersionSource'}, + 'lun': {'key': 'lun', 'type': 'int'}, + } + + def __init__( + self, + *, + lun: int, + host_caching: Optional[Union[str, "HostCaching"]] = None, + source: Optional["GalleryArtifactVersionSource"] = None, + **kwargs + ): + super(GalleryDataDiskImage, self).__init__(host_caching=host_caching, source=source, **kwargs) + self.lun = lun + + +class GalleryIdentifier(msrest.serialization.Model): + """Describes the gallery unique name. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar unique_name: The unique name of the Shared Image Gallery. This name is generated + automatically by Azure. + :vartype unique_name: str + """ + + _validation = { + 'unique_name': {'readonly': True}, + } + + _attribute_map = { + 'unique_name': {'key': 'uniqueName', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(GalleryIdentifier, self).__init__(**kwargs) + self.unique_name = None + + +class GalleryImage(Resource): + """Specifies information about the gallery image definition that you want to create or update. + + 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: Resource Id. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param location: Required. Resource location. + :type location: str + :param tags: A set of tags. Resource tags. + :type tags: dict[str, str] + :param description: The description of this gallery image definition resource. This property is + updatable. + :type description: str + :param eula: The Eula agreement for the gallery image definition. + :type eula: str + :param privacy_statement_uri: The privacy statement uri. + :type privacy_statement_uri: str + :param release_note_uri: The release note uri. + :type release_note_uri: str + :param os_type: This property allows you to specify the type of the OS that is included in the + disk when creating a VM from a managed image. :code:`
`:code:`
` Possible values are: + :code:`
`:code:`
` **Windows** :code:`
`:code:`
` **Linux**. Possible values + include: "Windows", "Linux". + :type os_type: str or ~azure.mgmt.compute.v2020_09_30.models.OperatingSystemTypes + :param os_state: This property allows the user to specify whether the virtual machines created + under this image are 'Generalized' or 'Specialized'. Possible values include: "Generalized", + "Specialized". + :type os_state: str or ~azure.mgmt.compute.v2020_09_30.models.OperatingSystemStateTypes + :param hyper_v_generation: The hypervisor generation of the Virtual Machine. Applicable to OS + disks only. Possible values include: "V1", "V2". + :type hyper_v_generation: str or ~azure.mgmt.compute.v2020_09_30.models.HyperVGeneration + :param features: A list of gallery image features. + :type features: list[~azure.mgmt.compute.v2020_09_30.models.GalleryImageFeature] + :param end_of_life_date: The end of life date of the gallery image definition. This property + can be used for decommissioning purposes. This property is updatable. + :type end_of_life_date: ~datetime.datetime + :param identifier: This is the gallery image definition identifier. + :type identifier: ~azure.mgmt.compute.v2020_09_30.models.GalleryImageIdentifier + :param recommended: The properties describe the recommended machine configuration for this + Image Definition. These properties are updatable. + :type recommended: ~azure.mgmt.compute.v2020_09_30.models.RecommendedMachineConfiguration + :param disallowed: Describes the disallowed disk types. + :type disallowed: ~azure.mgmt.compute.v2020_09_30.models.Disallowed + :param purchase_plan: Describes the gallery image definition purchase plan. This is used by + marketplace images. + :type purchase_plan: ~azure.mgmt.compute.v2020_09_30.models.ImagePurchasePlan + :ivar provisioning_state: The provisioning state, which only appears in the response. Possible + values include: "Creating", "Updating", "Failed", "Succeeded", "Deleting", "Migrating". + :vartype provisioning_state: str or + ~azure.mgmt.compute.v2020_09_30.models.GalleryImagePropertiesProvisioningState + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': True}, + 'provisioning_state': {'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}'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + 'eula': {'key': 'properties.eula', 'type': 'str'}, + 'privacy_statement_uri': {'key': 'properties.privacyStatementUri', 'type': 'str'}, + 'release_note_uri': {'key': 'properties.releaseNoteUri', 'type': 'str'}, + 'os_type': {'key': 'properties.osType', 'type': 'str'}, + 'os_state': {'key': 'properties.osState', 'type': 'str'}, + 'hyper_v_generation': {'key': 'properties.hyperVGeneration', 'type': 'str'}, + 'features': {'key': 'properties.features', 'type': '[GalleryImageFeature]'}, + 'end_of_life_date': {'key': 'properties.endOfLifeDate', 'type': 'iso-8601'}, + 'identifier': {'key': 'properties.identifier', 'type': 'GalleryImageIdentifier'}, + 'recommended': {'key': 'properties.recommended', 'type': 'RecommendedMachineConfiguration'}, + 'disallowed': {'key': 'properties.disallowed', 'type': 'Disallowed'}, + 'purchase_plan': {'key': 'properties.purchasePlan', 'type': 'ImagePurchasePlan'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + } + + def __init__( + self, + *, + location: str, + tags: Optional[Dict[str, str]] = None, + description: Optional[str] = None, + eula: Optional[str] = None, + privacy_statement_uri: Optional[str] = None, + release_note_uri: Optional[str] = None, + os_type: Optional[Union[str, "OperatingSystemTypes"]] = None, + os_state: Optional[Union[str, "OperatingSystemStateTypes"]] = None, + hyper_v_generation: Optional[Union[str, "HyperVGeneration"]] = None, + features: Optional[List["GalleryImageFeature"]] = None, + end_of_life_date: Optional[datetime.datetime] = None, + identifier: Optional["GalleryImageIdentifier"] = None, + recommended: Optional["RecommendedMachineConfiguration"] = None, + disallowed: Optional["Disallowed"] = None, + purchase_plan: Optional["ImagePurchasePlan"] = None, + **kwargs + ): + super(GalleryImage, self).__init__(location=location, tags=tags, **kwargs) + self.description = description + self.eula = eula + self.privacy_statement_uri = privacy_statement_uri + self.release_note_uri = release_note_uri + self.os_type = os_type + self.os_state = os_state + self.hyper_v_generation = hyper_v_generation + self.features = features + self.end_of_life_date = end_of_life_date + self.identifier = identifier + self.recommended = recommended + self.disallowed = disallowed + self.purchase_plan = purchase_plan + self.provisioning_state = None + + +class GalleryImageFeature(msrest.serialization.Model): + """A feature for gallery image. + + :param name: The name of the gallery image feature. + :type name: str + :param value: The value of the gallery image feature. + :type value: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'value': {'key': 'value', 'type': 'str'}, + } + + def __init__( + self, + *, + name: Optional[str] = None, + value: Optional[str] = None, + **kwargs + ): + super(GalleryImageFeature, self).__init__(**kwargs) + self.name = name + self.value = value + + +class GalleryImageIdentifier(msrest.serialization.Model): + """This is the gallery image definition identifier. + + All required parameters must be populated in order to send to Azure. + + :param publisher: Required. The name of the gallery image definition publisher. + :type publisher: str + :param offer: Required. The name of the gallery image definition offer. + :type offer: str + :param sku: Required. The name of the gallery image definition SKU. + :type sku: str + """ + + _validation = { + 'publisher': {'required': True}, + 'offer': {'required': True}, + 'sku': {'required': True}, + } + + _attribute_map = { + 'publisher': {'key': 'publisher', 'type': 'str'}, + 'offer': {'key': 'offer', 'type': 'str'}, + 'sku': {'key': 'sku', 'type': 'str'}, + } + + def __init__( + self, + *, + publisher: str, + offer: str, + sku: str, + **kwargs + ): + super(GalleryImageIdentifier, self).__init__(**kwargs) + self.publisher = publisher + self.offer = offer + self.sku = sku + + +class GalleryImageList(msrest.serialization.Model): + """The List Gallery Images operation response. + + All required parameters must be populated in order to send to Azure. + + :param value: Required. A list of Shared Image Gallery images. + :type value: list[~azure.mgmt.compute.v2020_09_30.models.GalleryImage] + :param next_link: The uri to fetch the next page of Image Definitions in the Shared Image + Gallery. Call ListNext() with this to fetch the next page of gallery image definitions. + :type next_link: str + """ + + _validation = { + 'value': {'required': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[GalleryImage]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: List["GalleryImage"], + next_link: Optional[str] = None, + **kwargs + ): + super(GalleryImageList, self).__init__(**kwargs) + self.value = value + self.next_link = next_link + + +class GalleryImageUpdate(UpdateResourceDefinition): + """Specifies information about the gallery image definition that you want to update. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param tags: A set of tags. Resource tags. + :type tags: dict[str, str] + :param description: The description of this gallery image definition resource. This property is + updatable. + :type description: str + :param eula: The Eula agreement for the gallery image definition. + :type eula: str + :param privacy_statement_uri: The privacy statement uri. + :type privacy_statement_uri: str + :param release_note_uri: The release note uri. + :type release_note_uri: str + :param os_type: This property allows you to specify the type of the OS that is included in the + disk when creating a VM from a managed image. :code:`
`:code:`
` Possible values are: + :code:`
`:code:`
` **Windows** :code:`
`:code:`
` **Linux**. Possible values + include: "Windows", "Linux". + :type os_type: str or ~azure.mgmt.compute.v2020_09_30.models.OperatingSystemTypes + :param os_state: This property allows the user to specify whether the virtual machines created + under this image are 'Generalized' or 'Specialized'. Possible values include: "Generalized", + "Specialized". + :type os_state: str or ~azure.mgmt.compute.v2020_09_30.models.OperatingSystemStateTypes + :param hyper_v_generation: The hypervisor generation of the Virtual Machine. Applicable to OS + disks only. Possible values include: "V1", "V2". + :type hyper_v_generation: str or ~azure.mgmt.compute.v2020_09_30.models.HyperVGeneration + :param features: A list of gallery image features. + :type features: list[~azure.mgmt.compute.v2020_09_30.models.GalleryImageFeature] + :param end_of_life_date: The end of life date of the gallery image definition. This property + can be used for decommissioning purposes. This property is updatable. + :type end_of_life_date: ~datetime.datetime + :param identifier: This is the gallery image definition identifier. + :type identifier: ~azure.mgmt.compute.v2020_09_30.models.GalleryImageIdentifier + :param recommended: The properties describe the recommended machine configuration for this + Image Definition. These properties are updatable. + :type recommended: ~azure.mgmt.compute.v2020_09_30.models.RecommendedMachineConfiguration + :param disallowed: Describes the disallowed disk types. + :type disallowed: ~azure.mgmt.compute.v2020_09_30.models.Disallowed + :param purchase_plan: Describes the gallery image definition purchase plan. This is used by + marketplace images. + :type purchase_plan: ~azure.mgmt.compute.v2020_09_30.models.ImagePurchasePlan + :ivar provisioning_state: The provisioning state, which only appears in the response. Possible + values include: "Creating", "Updating", "Failed", "Succeeded", "Deleting", "Migrating". + :vartype provisioning_state: str or + ~azure.mgmt.compute.v2020_09_30.models.GalleryImagePropertiesProvisioningState + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + 'eula': {'key': 'properties.eula', 'type': 'str'}, + 'privacy_statement_uri': {'key': 'properties.privacyStatementUri', 'type': 'str'}, + 'release_note_uri': {'key': 'properties.releaseNoteUri', 'type': 'str'}, + 'os_type': {'key': 'properties.osType', 'type': 'str'}, + 'os_state': {'key': 'properties.osState', 'type': 'str'}, + 'hyper_v_generation': {'key': 'properties.hyperVGeneration', 'type': 'str'}, + 'features': {'key': 'properties.features', 'type': '[GalleryImageFeature]'}, + 'end_of_life_date': {'key': 'properties.endOfLifeDate', 'type': 'iso-8601'}, + 'identifier': {'key': 'properties.identifier', 'type': 'GalleryImageIdentifier'}, + 'recommended': {'key': 'properties.recommended', 'type': 'RecommendedMachineConfiguration'}, + 'disallowed': {'key': 'properties.disallowed', 'type': 'Disallowed'}, + 'purchase_plan': {'key': 'properties.purchasePlan', 'type': 'ImagePurchasePlan'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + } + + def __init__( + self, + *, + tags: Optional[Dict[str, str]] = None, + description: Optional[str] = None, + eula: Optional[str] = None, + privacy_statement_uri: Optional[str] = None, + release_note_uri: Optional[str] = None, + os_type: Optional[Union[str, "OperatingSystemTypes"]] = None, + os_state: Optional[Union[str, "OperatingSystemStateTypes"]] = None, + hyper_v_generation: Optional[Union[str, "HyperVGeneration"]] = None, + features: Optional[List["GalleryImageFeature"]] = None, + end_of_life_date: Optional[datetime.datetime] = None, + identifier: Optional["GalleryImageIdentifier"] = None, + recommended: Optional["RecommendedMachineConfiguration"] = None, + disallowed: Optional["Disallowed"] = None, + purchase_plan: Optional["ImagePurchasePlan"] = None, + **kwargs + ): + super(GalleryImageUpdate, self).__init__(tags=tags, **kwargs) + self.description = description + self.eula = eula + self.privacy_statement_uri = privacy_statement_uri + self.release_note_uri = release_note_uri + self.os_type = os_type + self.os_state = os_state + self.hyper_v_generation = hyper_v_generation + self.features = features + self.end_of_life_date = end_of_life_date + self.identifier = identifier + self.recommended = recommended + self.disallowed = disallowed + self.purchase_plan = purchase_plan + self.provisioning_state = None + + +class GalleryImageVersion(Resource): + """Specifies information about the gallery image version that you want to create or update. + + 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: Resource Id. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param location: Required. Resource location. + :type location: str + :param tags: A set of tags. Resource tags. + :type tags: dict[str, str] + :param publishing_profile: Describes the basic gallery artifact publishing profile. + :type publishing_profile: + ~azure.mgmt.compute.v2020_09_30.models.GalleryArtifactPublishingProfileBase + :ivar provisioning_state: The provisioning state, which only appears in the response. Possible + values include: "Creating", "Updating", "Failed", "Succeeded", "Deleting", "Migrating". + :vartype provisioning_state: str or + ~azure.mgmt.compute.v2020_09_30.models.GalleryImageVersionPropertiesProvisioningState + :param storage_profile: This is the storage profile of a Gallery Image Version. + :type storage_profile: ~azure.mgmt.compute.v2020_09_30.models.GalleryImageVersionStorageProfile + :ivar replication_status: This is the replication status of the gallery image version. + :vartype replication_status: ~azure.mgmt.compute.v2020_09_30.models.ReplicationStatus + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': True}, + 'provisioning_state': {'readonly': True}, + 'replication_status': {'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}'}, + 'publishing_profile': {'key': 'properties.publishingProfile', 'type': 'GalleryArtifactPublishingProfileBase'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'storage_profile': {'key': 'properties.storageProfile', 'type': 'GalleryImageVersionStorageProfile'}, + 'replication_status': {'key': 'properties.replicationStatus', 'type': 'ReplicationStatus'}, + } + + def __init__( + self, + *, + location: str, + tags: Optional[Dict[str, str]] = None, + publishing_profile: Optional["GalleryArtifactPublishingProfileBase"] = None, + storage_profile: Optional["GalleryImageVersionStorageProfile"] = None, + **kwargs + ): + super(GalleryImageVersion, self).__init__(location=location, tags=tags, **kwargs) + self.publishing_profile = publishing_profile + self.provisioning_state = None + self.storage_profile = storage_profile + self.replication_status = None + + +class GalleryImageVersionList(msrest.serialization.Model): + """The List Gallery Image version operation response. + + All required parameters must be populated in order to send to Azure. + + :param value: Required. A list of gallery image versions. + :type value: list[~azure.mgmt.compute.v2020_09_30.models.GalleryImageVersion] + :param next_link: The uri to fetch the next page of gallery image versions. Call ListNext() + with this to fetch the next page of gallery image versions. + :type next_link: str + """ + + _validation = { + 'value': {'required': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[GalleryImageVersion]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: List["GalleryImageVersion"], + next_link: Optional[str] = None, + **kwargs + ): + super(GalleryImageVersionList, self).__init__(**kwargs) + self.value = value + self.next_link = next_link + + +class GalleryImageVersionPublishingProfile(GalleryArtifactPublishingProfileBase): + """The publishing profile of a gallery image Version. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param target_regions: The target regions where the Image Version is going to be replicated to. + This property is updatable. + :type target_regions: list[~azure.mgmt.compute.v2020_09_30.models.TargetRegion] + :param replica_count: The number of replicas of the Image Version to be created per region. + This property would take effect for a region when regionalReplicaCount is not specified. This + property is updatable. + :type replica_count: int + :param exclude_from_latest: If set to true, Virtual Machines deployed from the latest version + of the Image Definition won't use this Image Version. + :type exclude_from_latest: bool + :ivar published_date: The timestamp for when the gallery image version is published. + :vartype published_date: ~datetime.datetime + :param end_of_life_date: The end of life date of the gallery image version. This property can + be used for decommissioning purposes. This property is updatable. + :type end_of_life_date: ~datetime.datetime + :param storage_account_type: Specifies the storage account type to be used to store the image. + This property is not updatable. Possible values include: "Standard_LRS", "Standard_ZRS", + "Premium_LRS". + :type storage_account_type: str or ~azure.mgmt.compute.v2020_09_30.models.StorageAccountType + """ + + _validation = { + 'published_date': {'readonly': True}, + } + + _attribute_map = { + 'target_regions': {'key': 'targetRegions', 'type': '[TargetRegion]'}, + 'replica_count': {'key': 'replicaCount', 'type': 'int'}, + 'exclude_from_latest': {'key': 'excludeFromLatest', 'type': 'bool'}, + 'published_date': {'key': 'publishedDate', 'type': 'iso-8601'}, + 'end_of_life_date': {'key': 'endOfLifeDate', 'type': 'iso-8601'}, + 'storage_account_type': {'key': 'storageAccountType', 'type': 'str'}, + } + + def __init__( + self, + *, + target_regions: Optional[List["TargetRegion"]] = None, + replica_count: Optional[int] = None, + exclude_from_latest: Optional[bool] = None, + end_of_life_date: Optional[datetime.datetime] = None, + storage_account_type: Optional[Union[str, "StorageAccountType"]] = None, + **kwargs + ): + super(GalleryImageVersionPublishingProfile, self).__init__(target_regions=target_regions, replica_count=replica_count, exclude_from_latest=exclude_from_latest, end_of_life_date=end_of_life_date, storage_account_type=storage_account_type, **kwargs) + + +class GalleryImageVersionStorageProfile(msrest.serialization.Model): + """This is the storage profile of a Gallery Image Version. + + :param source: The gallery artifact version source. + :type source: ~azure.mgmt.compute.v2020_09_30.models.GalleryArtifactVersionSource + :param os_disk_image: This is the disk image base class. + :type os_disk_image: ~azure.mgmt.compute.v2020_09_30.models.GalleryDiskImage + :param data_disk_images: A list of data disk images. + :type data_disk_images: list[~azure.mgmt.compute.v2020_09_30.models.GalleryDataDiskImage] + """ + + _attribute_map = { + 'source': {'key': 'source', 'type': 'GalleryArtifactVersionSource'}, + 'os_disk_image': {'key': 'osDiskImage', 'type': 'GalleryDiskImage'}, + 'data_disk_images': {'key': 'dataDiskImages', 'type': '[GalleryDataDiskImage]'}, + } + + def __init__( + self, + *, + source: Optional["GalleryArtifactVersionSource"] = None, + os_disk_image: Optional["GalleryDiskImage"] = None, + data_disk_images: Optional[List["GalleryDataDiskImage"]] = None, + **kwargs + ): + super(GalleryImageVersionStorageProfile, self).__init__(**kwargs) + self.source = source + self.os_disk_image = os_disk_image + self.data_disk_images = data_disk_images + + +class GalleryImageVersionUpdate(UpdateResourceDefinition): + """Specifies information about the gallery image version that you want to update. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param tags: A set of tags. Resource tags. + :type tags: dict[str, str] + :param publishing_profile: Describes the basic gallery artifact publishing profile. + :type publishing_profile: + ~azure.mgmt.compute.v2020_09_30.models.GalleryArtifactPublishingProfileBase + :ivar provisioning_state: The provisioning state, which only appears in the response. Possible + values include: "Creating", "Updating", "Failed", "Succeeded", "Deleting", "Migrating". + :vartype provisioning_state: str or + ~azure.mgmt.compute.v2020_09_30.models.GalleryImageVersionPropertiesProvisioningState + :param storage_profile: This is the storage profile of a Gallery Image Version. + :type storage_profile: ~azure.mgmt.compute.v2020_09_30.models.GalleryImageVersionStorageProfile + :ivar replication_status: This is the replication status of the gallery image version. + :vartype replication_status: ~azure.mgmt.compute.v2020_09_30.models.ReplicationStatus + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + 'replication_status': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'publishing_profile': {'key': 'properties.publishingProfile', 'type': 'GalleryArtifactPublishingProfileBase'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'storage_profile': {'key': 'properties.storageProfile', 'type': 'GalleryImageVersionStorageProfile'}, + 'replication_status': {'key': 'properties.replicationStatus', 'type': 'ReplicationStatus'}, + } + + def __init__( + self, + *, + tags: Optional[Dict[str, str]] = None, + publishing_profile: Optional["GalleryArtifactPublishingProfileBase"] = None, + storage_profile: Optional["GalleryImageVersionStorageProfile"] = None, + **kwargs + ): + super(GalleryImageVersionUpdate, self).__init__(tags=tags, **kwargs) + self.publishing_profile = publishing_profile + self.provisioning_state = None + self.storage_profile = storage_profile + self.replication_status = None + + +class GalleryList(msrest.serialization.Model): + """The List Galleries operation response. + + All required parameters must be populated in order to send to Azure. + + :param value: Required. A list of galleries. + :type value: list[~azure.mgmt.compute.v2020_09_30.models.Gallery] + :param next_link: The uri to fetch the next page of galleries. Call ListNext() with this to + fetch the next page of galleries. + :type next_link: str + """ + + _validation = { + 'value': {'required': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[Gallery]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: List["Gallery"], + next_link: Optional[str] = None, + **kwargs + ): + super(GalleryList, self).__init__(**kwargs) + self.value = value + self.next_link = next_link + + +class GalleryOSDiskImage(GalleryDiskImage): + """This is the OS disk image. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar size_in_gb: This property indicates the size of the VHD to be created. + :vartype size_in_gb: int + :param host_caching: The host caching of the disk. Valid values are 'None', 'ReadOnly', and + 'ReadWrite'. Possible values include: "None", "ReadOnly", "ReadWrite". + :type host_caching: str or ~azure.mgmt.compute.v2020_09_30.models.HostCaching + :param source: The gallery artifact version source. + :type source: ~azure.mgmt.compute.v2020_09_30.models.GalleryArtifactVersionSource + """ + + _validation = { + 'size_in_gb': {'readonly': True}, + } + + _attribute_map = { + 'size_in_gb': {'key': 'sizeInGB', 'type': 'int'}, + 'host_caching': {'key': 'hostCaching', 'type': 'str'}, + 'source': {'key': 'source', 'type': 'GalleryArtifactVersionSource'}, + } + + def __init__( + self, + *, + host_caching: Optional[Union[str, "HostCaching"]] = None, + source: Optional["GalleryArtifactVersionSource"] = None, + **kwargs + ): + super(GalleryOSDiskImage, self).__init__(host_caching=host_caching, source=source, **kwargs) + + +class GalleryUpdate(UpdateResourceDefinition): + """Specifies information about the Shared Image Gallery that you want to update. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param tags: A set of tags. Resource tags. + :type tags: dict[str, str] + :param description: The description of this Shared Image Gallery resource. This property is + updatable. + :type description: str + :param identifier: Describes the gallery unique name. + :type identifier: ~azure.mgmt.compute.v2020_09_30.models.GalleryIdentifier + :ivar provisioning_state: The provisioning state, which only appears in the response. Possible + values include: "Creating", "Updating", "Failed", "Succeeded", "Deleting", "Migrating". + :vartype provisioning_state: str or + ~azure.mgmt.compute.v2020_09_30.models.GalleryPropertiesProvisioningState + :param sharing_profile: Profile for gallery sharing to subscription or tenant. + :type sharing_profile: ~azure.mgmt.compute.v2020_09_30.models.SharingProfile + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + 'identifier': {'key': 'properties.identifier', 'type': 'GalleryIdentifier'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'sharing_profile': {'key': 'properties.sharingProfile', 'type': 'SharingProfile'}, + } + + def __init__( + self, + *, + tags: Optional[Dict[str, str]] = None, + description: Optional[str] = None, + identifier: Optional["GalleryIdentifier"] = None, + sharing_profile: Optional["SharingProfile"] = None, + **kwargs + ): + super(GalleryUpdate, self).__init__(tags=tags, **kwargs) + self.description = description + self.identifier = identifier + self.provisioning_state = None + self.sharing_profile = sharing_profile + + +class GrantAccessData(msrest.serialization.Model): + """Data used for requesting a SAS. + + All required parameters must be populated in order to send to Azure. + + :param access: Required. Possible values include: "None", "Read", "Write". + :type access: str or ~azure.mgmt.compute.v2020_09_30.models.AccessLevel + :param duration_in_seconds: Required. Time duration in seconds until the SAS access expires. + :type duration_in_seconds: int + """ + + _validation = { + 'access': {'required': True}, + 'duration_in_seconds': {'required': True}, + } + + _attribute_map = { + 'access': {'key': 'access', 'type': 'str'}, + 'duration_in_seconds': {'key': 'durationInSeconds', 'type': 'int'}, + } + + def __init__( + self, + *, + access: Union[str, "AccessLevel"], + duration_in_seconds: int, + **kwargs + ): + super(GrantAccessData, self).__init__(**kwargs) + self.access = access + self.duration_in_seconds = duration_in_seconds + + +class ImageDiskReference(msrest.serialization.Model): + """The source image used for creating the disk. + + All required parameters must be populated in order to send to Azure. + + :param id: Required. A relative uri containing either a Platform Image Repository or user image + reference. + :type id: str + :param lun: If the disk is created from an image's data disk, this is an index that indicates + which of the data disks in the image to use. For OS disks, this field is null. + :type lun: int + """ + + _validation = { + 'id': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'lun': {'key': 'lun', 'type': 'int'}, + } + + def __init__( + self, + *, + id: str, + lun: Optional[int] = None, + **kwargs + ): + super(ImageDiskReference, self).__init__(**kwargs) + self.id = id + self.lun = lun + + +class ImagePurchasePlan(msrest.serialization.Model): + """Describes the gallery image definition purchase plan. This is used by marketplace images. + + :param name: The plan ID. + :type name: str + :param publisher: The publisher ID. + :type publisher: str + :param product: The product ID. + :type product: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'publisher': {'key': 'publisher', 'type': 'str'}, + 'product': {'key': 'product', 'type': 'str'}, + } + + def __init__( + self, + *, + name: Optional[str] = None, + publisher: Optional[str] = None, + product: Optional[str] = None, + **kwargs + ): + super(ImagePurchasePlan, self).__init__(**kwargs) + self.name = name + self.publisher = publisher + self.product = product + + +class InnerError(msrest.serialization.Model): + """Inner error details. + + :param exceptiontype: The exception type. + :type exceptiontype: str + :param errordetail: The internal error message or exception dump. + :type errordetail: str + """ + + _attribute_map = { + 'exceptiontype': {'key': 'exceptiontype', 'type': 'str'}, + 'errordetail': {'key': 'errordetail', 'type': 'str'}, + } + + def __init__( + self, + *, + exceptiontype: Optional[str] = None, + errordetail: Optional[str] = None, + **kwargs + ): + super(InnerError, self).__init__(**kwargs) + self.exceptiontype = exceptiontype + self.errordetail = errordetail + + +class KeyForDiskEncryptionSet(msrest.serialization.Model): + """Key Vault Key Url to be used for server side encryption of Managed Disks and Snapshots. + + All required parameters must be populated in order to send to Azure. + + :param source_vault: Resource id of the KeyVault containing the key or secret. This property is + optional and cannot be used if the KeyVault subscription is not the same as the Disk Encryption + Set subscription. + :type source_vault: ~azure.mgmt.compute.v2020_09_30.models.SourceVault + :param key_url: Required. Fully versioned Key Url pointing to a key in KeyVault. + :type key_url: str + """ + + _validation = { + 'key_url': {'required': True}, + } + + _attribute_map = { + 'source_vault': {'key': 'sourceVault', 'type': 'SourceVault'}, + 'key_url': {'key': 'keyUrl', 'type': 'str'}, + } + + def __init__( + self, + *, + key_url: str, + source_vault: Optional["SourceVault"] = None, + **kwargs + ): + super(KeyForDiskEncryptionSet, self).__init__(**kwargs) + self.source_vault = source_vault + self.key_url = key_url + + +class KeyVaultAndKeyReference(msrest.serialization.Model): + """Key Vault Key Url and vault id of KeK, KeK is optional and when provided is used to unwrap the encryptionKey. + + All required parameters must be populated in order to send to Azure. + + :param source_vault: Required. Resource id of the KeyVault containing the key or secret. + :type source_vault: ~azure.mgmt.compute.v2020_09_30.models.SourceVault + :param key_url: Required. Url pointing to a key or secret in KeyVault. + :type key_url: str + """ + + _validation = { + 'source_vault': {'required': True}, + 'key_url': {'required': True}, + } + + _attribute_map = { + 'source_vault': {'key': 'sourceVault', 'type': 'SourceVault'}, + 'key_url': {'key': 'keyUrl', 'type': 'str'}, + } + + def __init__( + self, + *, + source_vault: "SourceVault", + key_url: str, + **kwargs + ): + super(KeyVaultAndKeyReference, self).__init__(**kwargs) + self.source_vault = source_vault + self.key_url = key_url + + +class KeyVaultAndSecretReference(msrest.serialization.Model): + """Key Vault Secret Url and vault id of the encryption key. + + All required parameters must be populated in order to send to Azure. + + :param source_vault: Required. Resource id of the KeyVault containing the key or secret. + :type source_vault: ~azure.mgmt.compute.v2020_09_30.models.SourceVault + :param secret_url: Required. Url pointing to a key or secret in KeyVault. + :type secret_url: str + """ + + _validation = { + 'source_vault': {'required': True}, + 'secret_url': {'required': True}, + } + + _attribute_map = { + 'source_vault': {'key': 'sourceVault', 'type': 'SourceVault'}, + 'secret_url': {'key': 'secretUrl', 'type': 'str'}, + } + + def __init__( + self, + *, + source_vault: "SourceVault", + secret_url: str, + **kwargs + ): + super(KeyVaultAndSecretReference, self).__init__(**kwargs) + self.source_vault = source_vault + self.secret_url = secret_url + + +class ManagedArtifact(msrest.serialization.Model): + """The managed artifact. - 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. - :param target_regions: The target regions where the Image Version is going to be replicated to. - This property is updatable. - :type target_regions: list[~azure.mgmt.compute.v2020_09_30.models.TargetRegion] - :param replica_count: The number of replicas of the Image Version to be created per region. - This property would take effect for a region when regionalReplicaCount is not specified. This - property is updatable. - :type replica_count: int - :param exclude_from_latest: If set to true, Virtual Machines deployed from the latest version - of the Image Definition won't use this Image Version. - :type exclude_from_latest: bool - :ivar published_date: The timestamp for when the gallery image version is published. - :vartype published_date: ~datetime.datetime - :param end_of_life_date: The end of life date of the gallery image version. This property can - be used for decommissioning purposes. This property is updatable. - :type end_of_life_date: ~datetime.datetime - :param storage_account_type: Specifies the storage account type to be used to store the image. - This property is not updatable. Possible values include: "Standard_LRS", "Standard_ZRS", - "Premium_LRS". - :type storage_account_type: str or ~azure.mgmt.compute.v2020_09_30.models.StorageAccountType + :param id: Required. The managed artifact id. + :type id: str """ _validation = { - 'published_date': {'readonly': True}, + 'id': {'required': True}, } _attribute_map = { - 'target_regions': {'key': 'targetRegions', 'type': '[TargetRegion]'}, - 'replica_count': {'key': 'replicaCount', 'type': 'int'}, - 'exclude_from_latest': {'key': 'excludeFromLatest', 'type': 'bool'}, - 'published_date': {'key': 'publishedDate', 'type': 'iso-8601'}, - 'end_of_life_date': {'key': 'endOfLifeDate', 'type': 'iso-8601'}, - 'storage_account_type': {'key': 'storageAccountType', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, } def __init__( self, *, - target_regions: Optional[List["TargetRegion"]] = None, - replica_count: Optional[int] = None, - exclude_from_latest: Optional[bool] = None, - end_of_life_date: Optional[datetime.datetime] = None, - storage_account_type: Optional[Union[str, "StorageAccountType"]] = None, + id: str, **kwargs ): - super(GalleryImageVersionPublishingProfile, self).__init__(target_regions=target_regions, replica_count=replica_count, exclude_from_latest=exclude_from_latest, end_of_life_date=end_of_life_date, storage_account_type=storage_account_type, **kwargs) + super(ManagedArtifact, self).__init__(**kwargs) + self.id = id -class GalleryImageVersionStorageProfile(msrest.serialization.Model): - """This is the storage profile of a Gallery Image Version. +class OSDiskImageEncryption(DiskImageEncryption): + """Contains encryption settings for an OS disk image. - :param source: The gallery artifact version source. - :type source: ~azure.mgmt.compute.v2020_09_30.models.GalleryArtifactVersionSource - :param os_disk_image: This is the disk image base class. - :type os_disk_image: ~azure.mgmt.compute.v2020_09_30.models.GalleryDiskImage - :param data_disk_images: A list of data disk images. - :type data_disk_images: list[~azure.mgmt.compute.v2020_09_30.models.GalleryDataDiskImage] + :param disk_encryption_set_id: A relative URI containing the resource ID of the disk encryption + set. + :type disk_encryption_set_id: str """ _attribute_map = { - 'source': {'key': 'source', 'type': 'GalleryArtifactVersionSource'}, - 'os_disk_image': {'key': 'osDiskImage', 'type': 'GalleryDiskImage'}, - 'data_disk_images': {'key': 'dataDiskImages', 'type': '[GalleryDataDiskImage]'}, + 'disk_encryption_set_id': {'key': 'diskEncryptionSetId', 'type': 'str'}, } def __init__( self, *, - source: Optional["GalleryArtifactVersionSource"] = None, - os_disk_image: Optional["GalleryDiskImage"] = None, - data_disk_images: Optional[List["GalleryDataDiskImage"]] = None, + disk_encryption_set_id: Optional[str] = None, **kwargs ): - super(GalleryImageVersionStorageProfile, self).__init__(**kwargs) - self.source = source - self.os_disk_image = os_disk_image - self.data_disk_images = data_disk_images + super(OSDiskImageEncryption, self).__init__(disk_encryption_set_id=disk_encryption_set_id, **kwargs) -class GalleryImageVersionUpdate(UpdateResourceDefinition): - """Specifies information about the gallery image version that you want to update. +class PirResource(msrest.serialization.Model): + """The Resource model definition. Variables are only populated by the server, and will be ignored when sending a request. - :ivar id: Resource Id. - :vartype id: str :ivar name: Resource name. :vartype name: str - :ivar type: Resource type. - :vartype type: str - :param tags: A set of tags. Resource tags. - :type tags: dict[str, str] - :param publishing_profile: Describes the basic gallery artifact publishing profile. - :type publishing_profile: - ~azure.mgmt.compute.v2020_09_30.models.GalleryArtifactPublishingProfileBase - :ivar provisioning_state: The provisioning state, which only appears in the response. Possible - values include: "Creating", "Updating", "Failed", "Succeeded", "Deleting", "Migrating". - :vartype provisioning_state: str or - ~azure.mgmt.compute.v2020_09_30.models.GalleryImageVersionPropertiesProvisioningState - :param storage_profile: This is the storage profile of a Gallery Image Version. - :type storage_profile: ~azure.mgmt.compute.v2020_09_30.models.GalleryImageVersionStorageProfile - :ivar replication_status: This is the replication status of the gallery image version. - :vartype replication_status: ~azure.mgmt.compute.v2020_09_30.models.ReplicationStatus + :ivar location: Resource location. + :vartype location: str """ _validation = { - 'id': {'readonly': True}, 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'provisioning_state': {'readonly': True}, - 'replication_status': {'readonly': True}, + 'location': {'readonly': True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'publishing_profile': {'key': 'properties.publishingProfile', 'type': 'GalleryArtifactPublishingProfileBase'}, - 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, - 'storage_profile': {'key': 'properties.storageProfile', 'type': 'GalleryImageVersionStorageProfile'}, - 'replication_status': {'key': 'properties.replicationStatus', 'type': 'ReplicationStatus'}, + 'location': {'key': 'location', 'type': 'str'}, } def __init__( self, - *, - tags: Optional[Dict[str, str]] = None, - publishing_profile: Optional["GalleryArtifactPublishingProfileBase"] = None, - storage_profile: Optional["GalleryImageVersionStorageProfile"] = None, **kwargs ): - super(GalleryImageVersionUpdate, self).__init__(tags=tags, **kwargs) - self.publishing_profile = publishing_profile - self.provisioning_state = None - self.storage_profile = storage_profile - self.replication_status = None + super(PirResource, self).__init__(**kwargs) + self.name = None + self.location = None -class GalleryList(msrest.serialization.Model): - """The List Galleries operation response. +class PirSharedGalleryResource(PirResource): + """Base information about the shared gallery resource in pir. - All required parameters must be populated in order to send to Azure. + Variables are only populated by the server, and will be ignored when sending a request. - :param value: Required. A list of galleries. - :type value: list[~azure.mgmt.compute.v2020_09_30.models.Gallery] - :param next_link: The uri to fetch the next page of galleries. Call ListNext() with this to - fetch the next page of galleries. - :type next_link: str + :ivar name: Resource name. + :vartype name: str + :ivar location: Resource location. + :vartype location: str + :param unique_id: The unique id of this shared gallery. + :type unique_id: str """ _validation = { - 'value': {'required': True}, + 'name': {'readonly': True}, + 'location': {'readonly': True}, } _attribute_map = { - 'value': {'key': 'value', 'type': '[Gallery]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'unique_id': {'key': 'identifier.uniqueId', 'type': 'str'}, } def __init__( self, *, - value: List["Gallery"], - next_link: Optional[str] = None, + unique_id: Optional[str] = None, **kwargs ): - super(GalleryList, self).__init__(**kwargs) - self.value = value - self.next_link = next_link + super(PirSharedGalleryResource, self).__init__(**kwargs) + self.unique_id = unique_id -class GalleryOSDiskImage(GalleryDiskImage): - """This is the OS disk image. +class PrivateEndpoint(msrest.serialization.Model): + """The Private Endpoint resource. Variables are only populated by the server, and will be ignored when sending a request. - :ivar size_in_gb: This property indicates the size of the VHD to be created. - :vartype size_in_gb: int - :param host_caching: The host caching of the disk. Valid values are 'None', 'ReadOnly', and - 'ReadWrite'. Possible values include: "None", "ReadOnly", "ReadWrite". - :type host_caching: str or ~azure.mgmt.compute.v2020_09_30.models.HostCaching - :param source: The gallery artifact version source. - :type source: ~azure.mgmt.compute.v2020_09_30.models.GalleryArtifactVersionSource + :ivar id: The ARM identifier for Private Endpoint. + :vartype id: str """ _validation = { - 'size_in_gb': {'readonly': True}, + 'id': {'readonly': True}, } _attribute_map = { - 'size_in_gb': {'key': 'sizeInGB', 'type': 'int'}, - 'host_caching': {'key': 'hostCaching', 'type': 'str'}, - 'source': {'key': 'source', 'type': 'GalleryArtifactVersionSource'}, + 'id': {'key': 'id', 'type': 'str'}, } def __init__( self, - *, - host_caching: Optional[Union[str, "HostCaching"]] = None, - source: Optional["GalleryArtifactVersionSource"] = None, **kwargs ): - super(GalleryOSDiskImage, self).__init__(host_caching=host_caching, source=source, **kwargs) + super(PrivateEndpoint, self).__init__(**kwargs) + self.id = None -class GalleryUpdate(UpdateResourceDefinition): - """Specifies information about the Shared Image Gallery that you want to update. +class PrivateEndpointConnection(ProxyOnlyResource): + """The Private Endpoint Connection resource. Variables are only populated by the server, and will be ignored when sending a request. @@ -1634,19 +3110,16 @@ class GalleryUpdate(UpdateResourceDefinition): :vartype name: str :ivar type: Resource type. :vartype type: str - :param tags: A set of tags. Resource tags. - :type tags: dict[str, str] - :param description: The description of this Shared Image Gallery resource. This property is - updatable. - :type description: str - :param identifier: Describes the gallery unique name. - :type identifier: ~azure.mgmt.compute.v2020_09_30.models.GalleryIdentifier - :ivar provisioning_state: The provisioning state, which only appears in the response. Possible - values include: "Creating", "Updating", "Failed", "Succeeded", "Deleting", "Migrating". + :param private_endpoint: The resource of private end point. + :type private_endpoint: ~azure.mgmt.compute.v2020_09_30.models.PrivateEndpoint + :param private_link_service_connection_state: A collection of information about the state of + the connection between DiskAccess and Virtual Network. + :type private_link_service_connection_state: + ~azure.mgmt.compute.v2020_09_30.models.PrivateLinkServiceConnectionState + :ivar provisioning_state: The provisioning state of the private endpoint connection resource. + Possible values include: "Succeeded", "Creating", "Deleting", "Failed". :vartype provisioning_state: str or - ~azure.mgmt.compute.v2020_09_30.models.GalleryPropertiesProvisioningState - :param sharing_profile: Profile for gallery sharing to subscription or tenant. - :type sharing_profile: ~azure.mgmt.compute.v2020_09_30.models.SharingProfile + ~azure.mgmt.compute.v2020_09_30.models.PrivateEndpointConnectionProvisioningState """ _validation = { @@ -1660,196 +3133,200 @@ class GalleryUpdate(UpdateResourceDefinition): 'id': {'key': 'id', 'type': 'str'}, 'name': {'key': 'name', 'type': 'str'}, 'type': {'key': 'type', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'description': {'key': 'properties.description', 'type': 'str'}, - 'identifier': {'key': 'properties.identifier', 'type': 'GalleryIdentifier'}, + 'private_endpoint': {'key': 'properties.privateEndpoint', 'type': 'PrivateEndpoint'}, + 'private_link_service_connection_state': {'key': 'properties.privateLinkServiceConnectionState', 'type': 'PrivateLinkServiceConnectionState'}, 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, - 'sharing_profile': {'key': 'properties.sharingProfile', 'type': 'SharingProfile'}, } def __init__( self, *, - tags: Optional[Dict[str, str]] = None, - description: Optional[str] = None, - identifier: Optional["GalleryIdentifier"] = None, - sharing_profile: Optional["SharingProfile"] = None, + private_endpoint: Optional["PrivateEndpoint"] = None, + private_link_service_connection_state: Optional["PrivateLinkServiceConnectionState"] = None, **kwargs ): - super(GalleryUpdate, self).__init__(tags=tags, **kwargs) - self.description = description - self.identifier = identifier + super(PrivateEndpointConnection, self).__init__(**kwargs) + self.private_endpoint = private_endpoint + self.private_link_service_connection_state = private_link_service_connection_state self.provisioning_state = None - self.sharing_profile = sharing_profile - - -class ImagePurchasePlan(msrest.serialization.Model): - """Describes the gallery image definition purchase plan. This is used by marketplace images. - - :param name: The plan ID. - :type name: str - :param publisher: The publisher ID. - :type publisher: str - :param product: The product ID. - :type product: str - """ - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'publisher': {'key': 'publisher', 'type': 'str'}, - 'product': {'key': 'product', 'type': 'str'}, - } - - def __init__( - self, - *, - name: Optional[str] = None, - publisher: Optional[str] = None, - product: Optional[str] = None, - **kwargs - ): - super(ImagePurchasePlan, self).__init__(**kwargs) - self.name = name - self.publisher = publisher - self.product = product -class InnerError(msrest.serialization.Model): - """Inner error details. +class PrivateEndpointConnectionListResult(msrest.serialization.Model): + """A list of private link resources. - :param exceptiontype: The exception type. - :type exceptiontype: str - :param errordetail: The internal error message or exception dump. - :type errordetail: str + :param value: Array of private endpoint connections. + :type value: list[~azure.mgmt.compute.v2020_09_30.models.PrivateEndpointConnection] + :param next_link: The uri to fetch the next page of snapshots. Call ListNext() with this to + fetch the next page of snapshots. + :type next_link: str """ _attribute_map = { - 'exceptiontype': {'key': 'exceptiontype', 'type': 'str'}, - 'errordetail': {'key': 'errordetail', 'type': 'str'}, + 'value': {'key': 'value', 'type': '[PrivateEndpointConnection]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, } def __init__( self, *, - exceptiontype: Optional[str] = None, - errordetail: Optional[str] = None, + value: Optional[List["PrivateEndpointConnection"]] = None, + next_link: Optional[str] = None, **kwargs ): - super(InnerError, self).__init__(**kwargs) - self.exceptiontype = exceptiontype - self.errordetail = errordetail + super(PrivateEndpointConnectionListResult, self).__init__(**kwargs) + self.value = value + self.next_link = next_link -class ManagedArtifact(msrest.serialization.Model): - """The managed artifact. +class PrivateLinkResource(msrest.serialization.Model): + """A private link resource. - All required parameters must be populated in order to send to Azure. + Variables are only populated by the server, and will be ignored when sending a request. - :param id: Required. The managed artifact id. - :type id: str + :ivar id: private link resource Id. + :vartype id: str + :ivar name: private link resource name. + :vartype name: str + :ivar type: private link resource type. + :vartype type: str + :ivar group_id: The private link resource group id. + :vartype group_id: str + :ivar required_members: The private link resource required member names. + :vartype required_members: list[str] + :param required_zone_names: The private link resource DNS zone name. + :type required_zone_names: list[str] """ _validation = { - 'id': {'required': True}, + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'group_id': {'readonly': True}, + 'required_members': {'readonly': True}, } _attribute_map = { 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'group_id': {'key': 'properties.groupId', 'type': 'str'}, + 'required_members': {'key': 'properties.requiredMembers', 'type': '[str]'}, + 'required_zone_names': {'key': 'properties.requiredZoneNames', 'type': '[str]'}, } def __init__( self, *, - id: str, + required_zone_names: Optional[List[str]] = None, **kwargs ): - super(ManagedArtifact, self).__init__(**kwargs) - self.id = id + super(PrivateLinkResource, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None + self.group_id = None + self.required_members = None + self.required_zone_names = required_zone_names -class OSDiskImageEncryption(DiskImageEncryption): - """Contains encryption settings for an OS disk image. +class PrivateLinkResourceListResult(msrest.serialization.Model): + """A list of private link resources. - :param disk_encryption_set_id: A relative URI containing the resource ID of the disk encryption - set. - :type disk_encryption_set_id: str + :param value: Array of private link resources. + :type value: list[~azure.mgmt.compute.v2020_09_30.models.PrivateLinkResource] """ _attribute_map = { - 'disk_encryption_set_id': {'key': 'diskEncryptionSetId', 'type': 'str'}, + 'value': {'key': 'value', 'type': '[PrivateLinkResource]'}, } def __init__( self, *, - disk_encryption_set_id: Optional[str] = None, + value: Optional[List["PrivateLinkResource"]] = None, **kwargs ): - super(OSDiskImageEncryption, self).__init__(disk_encryption_set_id=disk_encryption_set_id, **kwargs) - + super(PrivateLinkResourceListResult, self).__init__(**kwargs) + self.value = value -class PirResource(msrest.serialization.Model): - """The Resource model definition. - Variables are only populated by the server, and will be ignored when sending a request. +class PrivateLinkServiceConnectionState(msrest.serialization.Model): + """A collection of information about the state of the connection between service consumer and provider. - :ivar name: Resource name. - :vartype name: str - :ivar location: Resource location. - :vartype location: str + :param status: Indicates whether the connection has been Approved/Rejected/Removed by the owner + of the service. Possible values include: "Pending", "Approved", "Rejected". + :type status: str or + ~azure.mgmt.compute.v2020_09_30.models.PrivateEndpointServiceConnectionStatus + :param description: The reason for approval/rejection of the connection. + :type description: str + :param actions_required: A message indicating if changes on the service provider require any + updates on the consumer. + :type actions_required: str """ - _validation = { - 'name': {'readonly': True}, - 'location': {'readonly': True}, - } - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'location': {'key': 'location', 'type': 'str'}, + 'status': {'key': 'status', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + 'actions_required': {'key': 'actionsRequired', 'type': 'str'}, } def __init__( self, + *, + status: Optional[Union[str, "PrivateEndpointServiceConnectionStatus"]] = None, + description: Optional[str] = None, + actions_required: Optional[str] = None, **kwargs ): - super(PirResource, self).__init__(**kwargs) - self.name = None - self.location = None + super(PrivateLinkServiceConnectionState, self).__init__(**kwargs) + self.status = status + self.description = description + self.actions_required = actions_required -class PirSharedGalleryResource(PirResource): - """Base information about the shared gallery resource in pir. +class PurchasePlan(msrest.serialization.Model): + """Used for establishing the purchase context of any 3rd Party artifact through MarketPlace. - 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 name: Resource name. - :vartype name: str - :ivar location: Resource location. - :vartype location: str - :param unique_id: The unique id of this shared gallery. - :type unique_id: str + :param name: Required. The plan ID. + :type name: str + :param publisher: Required. The publisher ID. + :type publisher: str + :param product: Required. Specifies the product of the image from the marketplace. This is the + same value as Offer under the imageReference element. + :type product: str + :param promotion_code: The Offer Promotion Code. + :type promotion_code: str """ _validation = { - 'name': {'readonly': True}, - 'location': {'readonly': True}, + 'name': {'required': True}, + 'publisher': {'required': True}, + 'product': {'required': True}, } _attribute_map = { 'name': {'key': 'name', 'type': 'str'}, - 'location': {'key': 'location', 'type': 'str'}, - 'unique_id': {'key': 'identifier.uniqueId', 'type': 'str'}, + 'publisher': {'key': 'publisher', 'type': 'str'}, + 'product': {'key': 'product', 'type': 'str'}, + 'promotion_code': {'key': 'promotionCode', 'type': 'str'}, } def __init__( self, *, - unique_id: Optional[str] = None, + name: str, + publisher: str, + product: str, + promotion_code: Optional[str] = None, **kwargs ): - super(PirSharedGalleryResource, self).__init__(**kwargs) - self.unique_id = unique_id + super(PurchasePlan, self).__init__(**kwargs) + self.name = name + self.publisher = publisher + self.product = product + self.promotion_code = promotion_code class RecommendedMachineConfiguration(msrest.serialization.Model): @@ -1978,6 +3455,40 @@ def __init__( self.max = max +class ResourceUriList(msrest.serialization.Model): + """The List resources which are encrypted with the disk encryption set. + + All required parameters must be populated in order to send to Azure. + + :param value: Required. A list of IDs or Owner IDs of resources which are encrypted with the + disk encryption set. + :type value: list[str] + :param next_link: The uri to fetch the next page of encrypted resources. Call ListNext() with + this to fetch the next page of encrypted resources. + :type next_link: str + """ + + _validation = { + 'value': {'required': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[str]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: List[str], + next_link: Optional[str] = None, + **kwargs + ): + super(ResourceUriList, self).__init__(**kwargs) + self.value = value + self.next_link = next_link + + class SharedGallery(PirSharedGalleryResource): """Specifies information about the Shared Gallery that you want to create or update. @@ -2242,6 +3753,31 @@ def __init__( self.next_link = next_link +class ShareInfoElement(msrest.serialization.Model): + """ShareInfoElement. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar vm_uri: A relative URI containing the ID of the VM that has the disk attached. + :vartype vm_uri: str + """ + + _validation = { + 'vm_uri': {'readonly': True}, + } + + _attribute_map = { + 'vm_uri': {'key': 'vmUri', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ShareInfoElement, self).__init__(**kwargs) + self.vm_uri = None + + class SharingProfile(msrest.serialization.Model): """Profile for gallery sharing to subscription or tenant. @@ -2339,6 +3875,306 @@ def __init__( self.groups = groups +class Snapshot(Resource): + """Snapshot resource. + + 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: Resource Id. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param location: Required. Resource location. + :type location: str + :param tags: A set of tags. Resource tags. + :type tags: dict[str, str] + :ivar managed_by: Unused. Always Null. + :vartype managed_by: str + :param sku: The snapshots sku name. Can be Standard_LRS, Premium_LRS, or Standard_ZRS. This is + an optional parameter for incremental snapshot and the default behavior is the SKU will be set + to the same sku as the previous snapshot. + :type sku: ~azure.mgmt.compute.v2020_09_30.models.SnapshotSku + :param extended_location: The extended location where the snapshot will be created. Extended + location cannot be changed. + :type extended_location: ~azure.mgmt.compute.v2020_09_30.models.ExtendedLocation + :ivar time_created: The time when the snapshot was created. + :vartype time_created: ~datetime.datetime + :param os_type: The Operating System type. Possible values include: "Windows", "Linux". + :type os_type: str or ~azure.mgmt.compute.v2020_09_30.models.OperatingSystemTypes + :param hyper_v_generation: The hypervisor generation of the Virtual Machine. Applicable to OS + disks only. Possible values include: "V1", "V2". + :type hyper_v_generation: str or ~azure.mgmt.compute.v2020_09_30.models.HyperVGeneration + :param purchase_plan: Purchase plan information for the image from which the source disk for + the snapshot was originally created. + :type purchase_plan: ~azure.mgmt.compute.v2020_09_30.models.PurchasePlan + :param creation_data: Disk source information. CreationData information cannot be changed after + the disk has been created. + :type creation_data: ~azure.mgmt.compute.v2020_09_30.models.CreationData + :param disk_size_gb: If creationData.createOption is Empty, this field is mandatory and it + indicates the size of the disk to create. If this field is present for updates or creation with + other options, it indicates a resize. Resizes are only allowed if the disk is not attached to a + running VM, and can only increase the disk's size. + :type disk_size_gb: int + :ivar disk_size_bytes: The size of the disk in bytes. This field is read only. + :vartype disk_size_bytes: long + :ivar disk_state: The state of the snapshot. Possible values include: "Unattached", "Attached", + "Reserved", "ActiveSAS", "ReadyToUpload", "ActiveUpload". + :vartype disk_state: str or ~azure.mgmt.compute.v2020_09_30.models.DiskState + :ivar unique_id: Unique Guid identifying the resource. + :vartype unique_id: str + :param encryption_settings_collection: Encryption settings collection used be Azure Disk + Encryption, can contain multiple encryption settings per disk or snapshot. + :type encryption_settings_collection: + ~azure.mgmt.compute.v2020_09_30.models.EncryptionSettingsCollection + :ivar provisioning_state: The disk provisioning state. + :vartype provisioning_state: str + :param incremental: Whether a snapshot is incremental. Incremental snapshots on the same disk + occupy less space than full snapshots and can be diffed. + :type incremental: bool + :param encryption: Encryption property can be used to encrypt data at rest with customer + managed keys or platform managed keys. + :type encryption: ~azure.mgmt.compute.v2020_09_30.models.Encryption + :param network_access_policy: Policy for accessing the disk via network. Possible values + include: "AllowAll", "AllowPrivate", "DenyAll". + :type network_access_policy: str or ~azure.mgmt.compute.v2020_09_30.models.NetworkAccessPolicy + :param disk_access_id: ARM id of the DiskAccess resource for using private endpoints on disks. + :type disk_access_id: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': True}, + 'managed_by': {'readonly': True}, + 'time_created': {'readonly': True}, + 'disk_size_bytes': {'readonly': True}, + 'disk_state': {'readonly': True}, + 'unique_id': {'readonly': True}, + 'provisioning_state': {'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}'}, + 'managed_by': {'key': 'managedBy', 'type': 'str'}, + 'sku': {'key': 'sku', 'type': 'SnapshotSku'}, + 'extended_location': {'key': 'extendedLocation', 'type': 'ExtendedLocation'}, + 'time_created': {'key': 'properties.timeCreated', 'type': 'iso-8601'}, + 'os_type': {'key': 'properties.osType', 'type': 'str'}, + 'hyper_v_generation': {'key': 'properties.hyperVGeneration', 'type': 'str'}, + 'purchase_plan': {'key': 'properties.purchasePlan', 'type': 'PurchasePlan'}, + 'creation_data': {'key': 'properties.creationData', 'type': 'CreationData'}, + 'disk_size_gb': {'key': 'properties.diskSizeGB', 'type': 'int'}, + 'disk_size_bytes': {'key': 'properties.diskSizeBytes', 'type': 'long'}, + 'disk_state': {'key': 'properties.diskState', 'type': 'str'}, + 'unique_id': {'key': 'properties.uniqueId', 'type': 'str'}, + 'encryption_settings_collection': {'key': 'properties.encryptionSettingsCollection', 'type': 'EncryptionSettingsCollection'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'incremental': {'key': 'properties.incremental', 'type': 'bool'}, + 'encryption': {'key': 'properties.encryption', 'type': 'Encryption'}, + 'network_access_policy': {'key': 'properties.networkAccessPolicy', 'type': 'str'}, + 'disk_access_id': {'key': 'properties.diskAccessId', 'type': 'str'}, + } + + def __init__( + self, + *, + location: str, + tags: Optional[Dict[str, str]] = None, + sku: Optional["SnapshotSku"] = None, + extended_location: Optional["ExtendedLocation"] = None, + os_type: Optional[Union[str, "OperatingSystemTypes"]] = None, + hyper_v_generation: Optional[Union[str, "HyperVGeneration"]] = None, + purchase_plan: Optional["PurchasePlan"] = None, + creation_data: Optional["CreationData"] = None, + disk_size_gb: Optional[int] = None, + encryption_settings_collection: Optional["EncryptionSettingsCollection"] = None, + incremental: Optional[bool] = None, + encryption: Optional["Encryption"] = None, + network_access_policy: Optional[Union[str, "NetworkAccessPolicy"]] = None, + disk_access_id: Optional[str] = None, + **kwargs + ): + super(Snapshot, self).__init__(location=location, tags=tags, **kwargs) + self.managed_by = None + self.sku = sku + self.extended_location = extended_location + self.time_created = None + self.os_type = os_type + self.hyper_v_generation = hyper_v_generation + self.purchase_plan = purchase_plan + self.creation_data = creation_data + self.disk_size_gb = disk_size_gb + self.disk_size_bytes = None + self.disk_state = None + self.unique_id = None + self.encryption_settings_collection = encryption_settings_collection + self.provisioning_state = None + self.incremental = incremental + self.encryption = encryption + self.network_access_policy = network_access_policy + self.disk_access_id = disk_access_id + + +class SnapshotList(msrest.serialization.Model): + """The List Snapshots operation response. + + All required parameters must be populated in order to send to Azure. + + :param value: Required. A list of snapshots. + :type value: list[~azure.mgmt.compute.v2020_09_30.models.Snapshot] + :param next_link: The uri to fetch the next page of snapshots. Call ListNext() with this to + fetch the next page of snapshots. + :type next_link: str + """ + + _validation = { + 'value': {'required': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[Snapshot]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: List["Snapshot"], + next_link: Optional[str] = None, + **kwargs + ): + super(SnapshotList, self).__init__(**kwargs) + self.value = value + self.next_link = next_link + + +class SnapshotSku(msrest.serialization.Model): + """The snapshots sku name. Can be Standard_LRS, Premium_LRS, or Standard_ZRS. This is an optional parameter for incremental snapshot and the default behavior is the SKU will be set to the same sku as the previous snapshot. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param name: The sku name. Possible values include: "Standard_LRS", "Premium_LRS", + "Standard_ZRS". + :type name: str or ~azure.mgmt.compute.v2020_09_30.models.SnapshotStorageAccountTypes + :ivar tier: The sku tier. + :vartype tier: str + """ + + _validation = { + 'tier': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'tier': {'key': 'tier', 'type': 'str'}, + } + + def __init__( + self, + *, + name: Optional[Union[str, "SnapshotStorageAccountTypes"]] = None, + **kwargs + ): + super(SnapshotSku, self).__init__(**kwargs) + self.name = name + self.tier = None + + +class SnapshotUpdate(msrest.serialization.Model): + """Snapshot update resource. + + :param tags: A set of tags. Resource tags. + :type tags: dict[str, str] + :param sku: The snapshots sku name. Can be Standard_LRS, Premium_LRS, or Standard_ZRS. This is + an optional parameter for incremental snapshot and the default behavior is the SKU will be set + to the same sku as the previous snapshot. + :type sku: ~azure.mgmt.compute.v2020_09_30.models.SnapshotSku + :param os_type: the Operating System type. Possible values include: "Windows", "Linux". + :type os_type: str or ~azure.mgmt.compute.v2020_09_30.models.OperatingSystemTypes + :param disk_size_gb: If creationData.createOption is Empty, this field is mandatory and it + indicates the size of the disk to create. If this field is present for updates or creation with + other options, it indicates a resize. Resizes are only allowed if the disk is not attached to a + running VM, and can only increase the disk's size. + :type disk_size_gb: int + :param encryption_settings_collection: Encryption settings collection used be Azure Disk + Encryption, can contain multiple encryption settings per disk or snapshot. + :type encryption_settings_collection: + ~azure.mgmt.compute.v2020_09_30.models.EncryptionSettingsCollection + :param encryption: Encryption property can be used to encrypt data at rest with customer + managed keys or platform managed keys. + :type encryption: ~azure.mgmt.compute.v2020_09_30.models.Encryption + :param network_access_policy: Policy for accessing the disk via network. Possible values + include: "AllowAll", "AllowPrivate", "DenyAll". + :type network_access_policy: str or ~azure.mgmt.compute.v2020_09_30.models.NetworkAccessPolicy + :param disk_access_id: ARM id of the DiskAccess resource for using private endpoints on disks. + :type disk_access_id: str + """ + + _attribute_map = { + 'tags': {'key': 'tags', 'type': '{str}'}, + 'sku': {'key': 'sku', 'type': 'SnapshotSku'}, + 'os_type': {'key': 'properties.osType', 'type': 'str'}, + 'disk_size_gb': {'key': 'properties.diskSizeGB', 'type': 'int'}, + 'encryption_settings_collection': {'key': 'properties.encryptionSettingsCollection', 'type': 'EncryptionSettingsCollection'}, + 'encryption': {'key': 'properties.encryption', 'type': 'Encryption'}, + 'network_access_policy': {'key': 'properties.networkAccessPolicy', 'type': 'str'}, + 'disk_access_id': {'key': 'properties.diskAccessId', 'type': 'str'}, + } + + def __init__( + self, + *, + tags: Optional[Dict[str, str]] = None, + sku: Optional["SnapshotSku"] = None, + os_type: Optional[Union[str, "OperatingSystemTypes"]] = None, + disk_size_gb: Optional[int] = None, + encryption_settings_collection: Optional["EncryptionSettingsCollection"] = None, + encryption: Optional["Encryption"] = None, + network_access_policy: Optional[Union[str, "NetworkAccessPolicy"]] = None, + disk_access_id: Optional[str] = None, + **kwargs + ): + super(SnapshotUpdate, self).__init__(**kwargs) + self.tags = tags + self.sku = sku + self.os_type = os_type + self.disk_size_gb = disk_size_gb + self.encryption_settings_collection = encryption_settings_collection + self.encryption = encryption + self.network_access_policy = network_access_policy + self.disk_access_id = disk_access_id + + +class SourceVault(msrest.serialization.Model): + """The vault id is an Azure Resource Manager Resource id in the form /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.KeyVault/vaults/{vaultName}. + + :param id: Resource Id. + :type id: str + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + } + + def __init__( + self, + *, + id: Optional[str] = None, + **kwargs + ): + super(SourceVault, self).__init__(**kwargs) + self.id = id + + class TargetRegion(msrest.serialization.Model): """Describes the target region information. diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_09_30/operations/__init__.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_09_30/operations/__init__.py index 2999cc9432ab..fa8761318cfa 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_09_30/operations/__init__.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_09_30/operations/__init__.py @@ -6,6 +6,11 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +from ._disks_operations import DisksOperations +from ._snapshots_operations import SnapshotsOperations +from ._disk_encryption_sets_operations import DiskEncryptionSetsOperations +from ._disk_accesses_operations import DiskAccessesOperations +from ._disk_restore_point_operations import DiskRestorePointOperations from ._galleries_operations import GalleriesOperations from ._gallery_images_operations import GalleryImagesOperations from ._gallery_image_versions_operations import GalleryImageVersionsOperations @@ -17,6 +22,11 @@ from ._shared_gallery_image_versions_operations import SharedGalleryImageVersionsOperations __all__ = [ + 'DisksOperations', + 'SnapshotsOperations', + 'DiskEncryptionSetsOperations', + 'DiskAccessesOperations', + 'DiskRestorePointOperations', 'GalleriesOperations', 'GalleryImagesOperations', 'GalleryImageVersionsOperations', diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_09_30/operations/_disk_accesses_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_09_30/operations/_disk_accesses_operations.py new file mode 100644 index 000000000000..e840d6a4527b --- /dev/null +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_09_30/operations/_disk_accesses_operations.py @@ -0,0 +1,1086 @@ +# 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 typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.core.polling import LROPoller, NoPolling, PollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.arm_polling import ARMPolling + +from .. import models as _models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class DiskAccessesOperations(object): + """DiskAccessesOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.compute.v2020_09_30.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def _create_or_update_initial( + self, + resource_group_name, # type: str + disk_access_name, # type: str + disk_access, # type: "_models.DiskAccess" + **kwargs # type: Any + ): + # type: (...) -> "_models.DiskAccess" + cls = kwargs.pop('cls', None) # type: ClsType["_models.DiskAccess"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-30" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._create_or_update_initial.metadata['url'] # type: ignore + 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'), + 'diskAccessName': self._serialize.url("disk_access_name", disk_access_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(disk_access, 'DiskAccess') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('DiskAccess', pipeline_response) + + if response.status_code == 202: + deserialized = self._deserialize('DiskAccess', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskAccesses/{diskAccessName}'} # type: ignore + + def begin_create_or_update( + self, + resource_group_name, # type: str + disk_access_name, # type: str + disk_access, # type: "_models.DiskAccess" + **kwargs # type: Any + ): + # type: (...) -> LROPoller["_models.DiskAccess"] + """Creates or updates a disk access resource. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param disk_access_name: The name of the disk access resource that is being created. The name + can't be changed after the disk encryption set is created. Supported characters for the name + are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. + :type disk_access_name: str + :param disk_access: disk access object supplied in the body of the Put disk access operation. + :type disk_access: ~azure.mgmt.compute.v2020_09_30.models.DiskAccess + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either DiskAccess or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.compute.v2020_09_30.models.DiskAccess] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DiskAccess"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._create_or_update_initial( + resource_group_name=resource_group_name, + disk_access_name=disk_access_name, + disk_access=disk_access, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('DiskAccess', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + 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'), + 'diskAccessName': self._serialize.url("disk_access_name", disk_access_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskAccesses/{diskAccessName}'} # type: ignore + + def _update_initial( + self, + resource_group_name, # type: str + disk_access_name, # type: str + disk_access, # type: "_models.DiskAccessUpdate" + **kwargs # type: Any + ): + # type: (...) -> "_models.DiskAccess" + cls = kwargs.pop('cls', None) # type: ClsType["_models.DiskAccess"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-30" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._update_initial.metadata['url'] # type: ignore + 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'), + 'diskAccessName': self._serialize.url("disk_access_name", disk_access_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(disk_access, 'DiskAccessUpdate') + body_content_kwargs['content'] = body_content + request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('DiskAccess', pipeline_response) + + if response.status_code == 202: + deserialized = self._deserialize('DiskAccess', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskAccesses/{diskAccessName}'} # type: ignore + + def begin_update( + self, + resource_group_name, # type: str + disk_access_name, # type: str + disk_access, # type: "_models.DiskAccessUpdate" + **kwargs # type: Any + ): + # type: (...) -> LROPoller["_models.DiskAccess"] + """Updates (patches) a disk access resource. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param disk_access_name: The name of the disk access resource that is being created. The name + can't be changed after the disk encryption set is created. Supported characters for the name + are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. + :type disk_access_name: str + :param disk_access: disk access object supplied in the body of the Patch disk access operation. + :type disk_access: ~azure.mgmt.compute.v2020_09_30.models.DiskAccessUpdate + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either DiskAccess or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.compute.v2020_09_30.models.DiskAccess] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DiskAccess"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._update_initial( + resource_group_name=resource_group_name, + disk_access_name=disk_access_name, + disk_access=disk_access, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('DiskAccess', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + 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'), + 'diskAccessName': self._serialize.url("disk_access_name", disk_access_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskAccesses/{diskAccessName}'} # type: ignore + + def get( + self, + resource_group_name, # type: str + disk_access_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.DiskAccess" + """Gets information about a disk access resource. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param disk_access_name: The name of the disk access resource that is being created. The name + can't be changed after the disk encryption set is created. Supported characters for the name + are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. + :type disk_access_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: DiskAccess, or the result of cls(response) + :rtype: ~azure.mgmt.compute.v2020_09_30.models.DiskAccess + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.DiskAccess"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-30" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + 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'), + 'diskAccessName': self._serialize.url("disk_access_name", disk_access_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('DiskAccess', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskAccesses/{diskAccessName}'} # type: ignore + + def _delete_initial( + self, + resource_group_name, # type: str + disk_access_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-30" + accept = "application/json" + + # Construct URL + url = self._delete_initial.metadata['url'] # type: ignore + 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'), + 'diskAccessName': self._serialize.url("disk_access_name", disk_access_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskAccesses/{diskAccessName}'} # type: ignore + + def begin_delete( + self, + resource_group_name, # type: str + disk_access_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> LROPoller[None] + """Deletes a disk access resource. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param disk_access_name: The name of the disk access resource that is being created. The name + can't be changed after the disk encryption set is created. Supported characters for the name + are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. + :type disk_access_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._delete_initial( + resource_group_name=resource_group_name, + disk_access_name=disk_access_name, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + 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'), + 'diskAccessName': self._serialize.url("disk_access_name", disk_access_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskAccesses/{diskAccessName}'} # type: ignore + + def list_by_resource_group( + self, + resource_group_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.DiskAccessList"] + """Lists all the disk access resources under a resource group. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either DiskAccessList or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.compute.v2020_09_30.models.DiskAccessList] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.DiskAccessList"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-30" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_by_resource_group.metadata['url'] # type: ignore + 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'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('DiskAccessList', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskAccesses'} # type: ignore + + def list( + self, + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.DiskAccessList"] + """Lists all the disk access resources under a subscription. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either DiskAccessList or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.compute.v2020_09_30.models.DiskAccessList] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.DiskAccessList"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-30" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('DiskAccessList', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Compute/diskAccesses'} # type: ignore + + def get_private_link_resources( + self, + resource_group_name, # type: str + disk_access_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.PrivateLinkResourceListResult" + """Gets the private link resources possible under disk access resource. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param disk_access_name: The name of the disk access resource that is being created. The name + can't be changed after the disk encryption set is created. Supported characters for the name + are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. + :type disk_access_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: PrivateLinkResourceListResult, or the result of cls(response) + :rtype: ~azure.mgmt.compute.v2020_09_30.models.PrivateLinkResourceListResult + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateLinkResourceListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-30" + accept = "application/json" + + # Construct URL + url = self.get_private_link_resources.metadata['url'] # type: ignore + 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'), + 'diskAccessName': self._serialize.url("disk_access_name", disk_access_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('PrivateLinkResourceListResult', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_private_link_resources.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskAccesses/{diskAccessName}/privateLinkResources'} # type: ignore + + def _update_a_private_endpoint_connection_initial( + self, + resource_group_name, # type: str + disk_access_name, # type: str + private_endpoint_connection_name, # type: str + private_endpoint_connection, # type: "_models.PrivateEndpointConnection" + **kwargs # type: Any + ): + # type: (...) -> "_models.PrivateEndpointConnection" + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateEndpointConnection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-30" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._update_a_private_endpoint_connection_initial.metadata['url'] # type: ignore + 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'), + 'diskAccessName': self._serialize.url("disk_access_name", disk_access_name, 'str'), + 'privateEndpointConnectionName': self._serialize.url("private_endpoint_connection_name", private_endpoint_connection_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(private_endpoint_connection, 'PrivateEndpointConnection') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('PrivateEndpointConnection', pipeline_response) + + if response.status_code == 202: + deserialized = self._deserialize('PrivateEndpointConnection', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _update_a_private_endpoint_connection_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskAccesses/{diskAccessName}/privateEndpointConnections/{privateEndpointConnectionName}'} # type: ignore + + def begin_update_a_private_endpoint_connection( + self, + resource_group_name, # type: str + disk_access_name, # type: str + private_endpoint_connection_name, # type: str + private_endpoint_connection, # type: "_models.PrivateEndpointConnection" + **kwargs # type: Any + ): + # type: (...) -> LROPoller["_models.PrivateEndpointConnection"] + """Approve or reject a private endpoint connection under disk access resource, this can't be used + to create a new private endpoint connection. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param disk_access_name: The name of the disk access resource that is being created. The name + can't be changed after the disk encryption set is created. Supported characters for the name + are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. + :type disk_access_name: str + :param private_endpoint_connection_name: The name of the private endpoint connection. + :type private_endpoint_connection_name: str + :param private_endpoint_connection: private endpoint connection object supplied in the body of + the Put private endpoint connection operation. + :type private_endpoint_connection: ~azure.mgmt.compute.v2020_09_30.models.PrivateEndpointConnection + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either PrivateEndpointConnection or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.compute.v2020_09_30.models.PrivateEndpointConnection] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateEndpointConnection"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._update_a_private_endpoint_connection_initial( + resource_group_name=resource_group_name, + disk_access_name=disk_access_name, + private_endpoint_connection_name=private_endpoint_connection_name, + private_endpoint_connection=private_endpoint_connection, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('PrivateEndpointConnection', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + 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'), + 'diskAccessName': self._serialize.url("disk_access_name", disk_access_name, 'str'), + 'privateEndpointConnectionName': self._serialize.url("private_endpoint_connection_name", private_endpoint_connection_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_update_a_private_endpoint_connection.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskAccesses/{diskAccessName}/privateEndpointConnections/{privateEndpointConnectionName}'} # type: ignore + + def get_a_private_endpoint_connection( + self, + resource_group_name, # type: str + disk_access_name, # type: str + private_endpoint_connection_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.PrivateEndpointConnection" + """Gets information about a private endpoint connection under a disk access resource. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param disk_access_name: The name of the disk access resource that is being created. The name + can't be changed after the disk encryption set is created. Supported characters for the name + are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. + :type disk_access_name: str + :param private_endpoint_connection_name: The name of the private endpoint connection. + :type private_endpoint_connection_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: PrivateEndpointConnection, or the result of cls(response) + :rtype: ~azure.mgmt.compute.v2020_09_30.models.PrivateEndpointConnection + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateEndpointConnection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-30" + accept = "application/json" + + # Construct URL + url = self.get_a_private_endpoint_connection.metadata['url'] # type: ignore + 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'), + 'diskAccessName': self._serialize.url("disk_access_name", disk_access_name, 'str'), + 'privateEndpointConnectionName': self._serialize.url("private_endpoint_connection_name", private_endpoint_connection_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('PrivateEndpointConnection', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_a_private_endpoint_connection.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskAccesses/{diskAccessName}/privateEndpointConnections/{privateEndpointConnectionName}'} # type: ignore + + def _delete_a_private_endpoint_connection_initial( + self, + resource_group_name, # type: str + disk_access_name, # type: str + private_endpoint_connection_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-30" + accept = "application/json" + + # Construct URL + url = self._delete_a_private_endpoint_connection_initial.metadata['url'] # type: ignore + 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'), + 'diskAccessName': self._serialize.url("disk_access_name", disk_access_name, 'str'), + 'privateEndpointConnectionName': self._serialize.url("private_endpoint_connection_name", private_endpoint_connection_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _delete_a_private_endpoint_connection_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskAccesses/{diskAccessName}/privateEndpointConnections/{privateEndpointConnectionName}'} # type: ignore + + def begin_delete_a_private_endpoint_connection( + self, + resource_group_name, # type: str + disk_access_name, # type: str + private_endpoint_connection_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> LROPoller[None] + """Deletes a private endpoint connection under a disk access resource. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param disk_access_name: The name of the disk access resource that is being created. The name + can't be changed after the disk encryption set is created. Supported characters for the name + are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. + :type disk_access_name: str + :param private_endpoint_connection_name: The name of the private endpoint connection. + :type private_endpoint_connection_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._delete_a_private_endpoint_connection_initial( + resource_group_name=resource_group_name, + disk_access_name=disk_access_name, + private_endpoint_connection_name=private_endpoint_connection_name, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + 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'), + 'diskAccessName': self._serialize.url("disk_access_name", disk_access_name, 'str'), + 'privateEndpointConnectionName': self._serialize.url("private_endpoint_connection_name", private_endpoint_connection_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete_a_private_endpoint_connection.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskAccesses/{diskAccessName}/privateEndpointConnections/{privateEndpointConnectionName}'} # type: ignore + + def list_private_endpoint_connections( + self, + resource_group_name, # type: str + disk_access_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.PrivateEndpointConnectionListResult"] + """List information about private endpoint connections under a disk access resource. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param disk_access_name: The name of the disk access resource that is being created. The name + can't be changed after the disk encryption set is created. Supported characters for the name + are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. + :type disk_access_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either PrivateEndpointConnectionListResult or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.compute.v2020_09_30.models.PrivateEndpointConnectionListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateEndpointConnectionListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-30" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_private_endpoint_connections.metadata['url'] # type: ignore + 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'), + 'diskAccessName': self._serialize.url("disk_access_name", disk_access_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('PrivateEndpointConnectionListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_private_endpoint_connections.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskAccesses/{diskAccessName}/privateEndpointConnections'} # type: ignore diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_09_30/operations/_disk_encryption_sets_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_09_30/operations/_disk_encryption_sets_operations.py new file mode 100644 index 000000000000..6a45064fde10 --- /dev/null +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_09_30/operations/_disk_encryption_sets_operations.py @@ -0,0 +1,702 @@ +# 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 typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.core.polling import LROPoller, NoPolling, PollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.arm_polling import ARMPolling + +from .. import models as _models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class DiskEncryptionSetsOperations(object): + """DiskEncryptionSetsOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.compute.v2020_09_30.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def _create_or_update_initial( + self, + resource_group_name, # type: str + disk_encryption_set_name, # type: str + disk_encryption_set, # type: "_models.DiskEncryptionSet" + **kwargs # type: Any + ): + # type: (...) -> "_models.DiskEncryptionSet" + cls = kwargs.pop('cls', None) # type: ClsType["_models.DiskEncryptionSet"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-30" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._create_or_update_initial.metadata['url'] # type: ignore + 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'), + 'diskEncryptionSetName': self._serialize.url("disk_encryption_set_name", disk_encryption_set_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(disk_encryption_set, 'DiskEncryptionSet') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('DiskEncryptionSet', pipeline_response) + + if response.status_code == 202: + deserialized = self._deserialize('DiskEncryptionSet', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskEncryptionSets/{diskEncryptionSetName}'} # type: ignore + + def begin_create_or_update( + self, + resource_group_name, # type: str + disk_encryption_set_name, # type: str + disk_encryption_set, # type: "_models.DiskEncryptionSet" + **kwargs # type: Any + ): + # type: (...) -> LROPoller["_models.DiskEncryptionSet"] + """Creates or updates a disk encryption set. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param disk_encryption_set_name: The name of the disk encryption set that is being created. The + name can't be changed after the disk encryption set is created. Supported characters for the + name are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. + :type disk_encryption_set_name: str + :param disk_encryption_set: disk encryption set object supplied in the body of the Put disk + encryption set operation. + :type disk_encryption_set: ~azure.mgmt.compute.v2020_09_30.models.DiskEncryptionSet + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either DiskEncryptionSet or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.compute.v2020_09_30.models.DiskEncryptionSet] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DiskEncryptionSet"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._create_or_update_initial( + resource_group_name=resource_group_name, + disk_encryption_set_name=disk_encryption_set_name, + disk_encryption_set=disk_encryption_set, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('DiskEncryptionSet', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + 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'), + 'diskEncryptionSetName': self._serialize.url("disk_encryption_set_name", disk_encryption_set_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskEncryptionSets/{diskEncryptionSetName}'} # type: ignore + + def _update_initial( + self, + resource_group_name, # type: str + disk_encryption_set_name, # type: str + disk_encryption_set, # type: "_models.DiskEncryptionSetUpdate" + **kwargs # type: Any + ): + # type: (...) -> "_models.DiskEncryptionSet" + cls = kwargs.pop('cls', None) # type: ClsType["_models.DiskEncryptionSet"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-30" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._update_initial.metadata['url'] # type: ignore + 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'), + 'diskEncryptionSetName': self._serialize.url("disk_encryption_set_name", disk_encryption_set_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(disk_encryption_set, 'DiskEncryptionSetUpdate') + body_content_kwargs['content'] = body_content + request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('DiskEncryptionSet', pipeline_response) + + if response.status_code == 202: + deserialized = self._deserialize('DiskEncryptionSet', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskEncryptionSets/{diskEncryptionSetName}'} # type: ignore + + def begin_update( + self, + resource_group_name, # type: str + disk_encryption_set_name, # type: str + disk_encryption_set, # type: "_models.DiskEncryptionSetUpdate" + **kwargs # type: Any + ): + # type: (...) -> LROPoller["_models.DiskEncryptionSet"] + """Updates (patches) a disk encryption set. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param disk_encryption_set_name: The name of the disk encryption set that is being created. The + name can't be changed after the disk encryption set is created. Supported characters for the + name are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. + :type disk_encryption_set_name: str + :param disk_encryption_set: disk encryption set object supplied in the body of the Patch disk + encryption set operation. + :type disk_encryption_set: ~azure.mgmt.compute.v2020_09_30.models.DiskEncryptionSetUpdate + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either DiskEncryptionSet or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.compute.v2020_09_30.models.DiskEncryptionSet] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DiskEncryptionSet"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._update_initial( + resource_group_name=resource_group_name, + disk_encryption_set_name=disk_encryption_set_name, + disk_encryption_set=disk_encryption_set, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('DiskEncryptionSet', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + 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'), + 'diskEncryptionSetName': self._serialize.url("disk_encryption_set_name", disk_encryption_set_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskEncryptionSets/{diskEncryptionSetName}'} # type: ignore + + def get( + self, + resource_group_name, # type: str + disk_encryption_set_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.DiskEncryptionSet" + """Gets information about a disk encryption set. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param disk_encryption_set_name: The name of the disk encryption set that is being created. The + name can't be changed after the disk encryption set is created. Supported characters for the + name are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. + :type disk_encryption_set_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: DiskEncryptionSet, or the result of cls(response) + :rtype: ~azure.mgmt.compute.v2020_09_30.models.DiskEncryptionSet + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.DiskEncryptionSet"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-30" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + 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'), + 'diskEncryptionSetName': self._serialize.url("disk_encryption_set_name", disk_encryption_set_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('DiskEncryptionSet', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskEncryptionSets/{diskEncryptionSetName}'} # type: ignore + + def _delete_initial( + self, + resource_group_name, # type: str + disk_encryption_set_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-30" + accept = "application/json" + + # Construct URL + url = self._delete_initial.metadata['url'] # type: ignore + 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'), + 'diskEncryptionSetName': self._serialize.url("disk_encryption_set_name", disk_encryption_set_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskEncryptionSets/{diskEncryptionSetName}'} # type: ignore + + def begin_delete( + self, + resource_group_name, # type: str + disk_encryption_set_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> LROPoller[None] + """Deletes a disk encryption set. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param disk_encryption_set_name: The name of the disk encryption set that is being created. The + name can't be changed after the disk encryption set is created. Supported characters for the + name are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. + :type disk_encryption_set_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._delete_initial( + resource_group_name=resource_group_name, + disk_encryption_set_name=disk_encryption_set_name, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + 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'), + 'diskEncryptionSetName': self._serialize.url("disk_encryption_set_name", disk_encryption_set_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskEncryptionSets/{diskEncryptionSetName}'} # type: ignore + + def list_by_resource_group( + self, + resource_group_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.DiskEncryptionSetList"] + """Lists all the disk encryption sets under a resource group. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either DiskEncryptionSetList or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.compute.v2020_09_30.models.DiskEncryptionSetList] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.DiskEncryptionSetList"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-30" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_by_resource_group.metadata['url'] # type: ignore + 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'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('DiskEncryptionSetList', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskEncryptionSets'} # type: ignore + + def list( + self, + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.DiskEncryptionSetList"] + """Lists all the disk encryption sets under a subscription. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either DiskEncryptionSetList or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.compute.v2020_09_30.models.DiskEncryptionSetList] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.DiskEncryptionSetList"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-30" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('DiskEncryptionSetList', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Compute/diskEncryptionSets'} # type: ignore + + def list_associated_resources( + self, + resource_group_name, # type: str + disk_encryption_set_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.ResourceUriList"] + """Lists all resources that are encrypted with this disk encryption set. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param disk_encryption_set_name: The name of the disk encryption set that is being created. The + name can't be changed after the disk encryption set is created. Supported characters for the + name are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. + :type disk_encryption_set_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either ResourceUriList or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.compute.v2020_09_30.models.ResourceUriList] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ResourceUriList"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-30" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_associated_resources.metadata['url'] # type: ignore + 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'), + 'diskEncryptionSetName': self._serialize.url("disk_encryption_set_name", disk_encryption_set_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('ResourceUriList', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_associated_resources.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskEncryptionSets/{diskEncryptionSetName}/associatedResources'} # type: ignore diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_09_30/operations/_disk_restore_point_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_09_30/operations/_disk_restore_point_operations.py new file mode 100644 index 000000000000..752e0598d153 --- /dev/null +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_09_30/operations/_disk_restore_point_operations.py @@ -0,0 +1,201 @@ +# 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 typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.mgmt.core.exceptions import ARMErrorFormat + +from .. import models as _models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class DiskRestorePointOperations(object): + """DiskRestorePointOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.compute.v2020_09_30.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def get( + self, + resource_group_name, # type: str + restore_point_collection_name, # type: str + vm_restore_point_name, # type: str + disk_restore_point_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.DiskRestorePoint" + """Get disk restorePoint resource. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param restore_point_collection_name: The name of the restore point collection that the disk + restore point belongs. Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum + name length is 80 characters. + :type restore_point_collection_name: str + :param vm_restore_point_name: The name of the vm restore point that the disk disk restore point + belongs. Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum name length is + 80 characters. + :type vm_restore_point_name: str + :param disk_restore_point_name: The name of the disk restore point created. Supported + characters for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. + :type disk_restore_point_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: DiskRestorePoint, or the result of cls(response) + :rtype: ~azure.mgmt.compute.v2020_09_30.models.DiskRestorePoint + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.DiskRestorePoint"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-30" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + 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'), + 'restorePointCollectionName': self._serialize.url("restore_point_collection_name", restore_point_collection_name, 'str'), + 'vmRestorePointName': self._serialize.url("vm_restore_point_name", vm_restore_point_name, 'str'), + 'diskRestorePointName': self._serialize.url("disk_restore_point_name", disk_restore_point_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('DiskRestorePoint', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/restorePointCollections/{restorePointCollectionName}/restorePoints/{vmRestorePointName}/diskRestorePoints/{diskRestorePointName}'} # type: ignore + + def list_by_restore_point( + self, + resource_group_name, # type: str + restore_point_collection_name, # type: str + vm_restore_point_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.DiskRestorePointList"] + """Lists diskRestorePoints under a vmRestorePoint. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param restore_point_collection_name: The name of the restore point collection that the disk + restore point belongs. Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum + name length is 80 characters. + :type restore_point_collection_name: str + :param vm_restore_point_name: The name of the vm restore point that the disk disk restore point + belongs. Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum name length is + 80 characters. + :type vm_restore_point_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either DiskRestorePointList or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.compute.v2020_09_30.models.DiskRestorePointList] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.DiskRestorePointList"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-30" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_by_restore_point.metadata['url'] # type: ignore + 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'), + 'restorePointCollectionName': self._serialize.url("restore_point_collection_name", restore_point_collection_name, 'str'), + 'vmRestorePointName': self._serialize.url("vm_restore_point_name", vm_restore_point_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('DiskRestorePointList', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_by_restore_point.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/restorePointCollections/{restorePointCollectionName}/restorePoints/{vmRestorePointName}/diskRestorePoints'} # type: ignore diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_09_30/operations/_disks_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_09_30/operations/_disks_operations.py new file mode 100644 index 000000000000..0af32908788f --- /dev/null +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_09_30/operations/_disks_operations.py @@ -0,0 +1,862 @@ +# 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 typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.core.polling import LROPoller, NoPolling, PollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.arm_polling import ARMPolling + +from .. import models as _models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class DisksOperations(object): + """DisksOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.compute.v2020_09_30.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def _create_or_update_initial( + self, + resource_group_name, # type: str + disk_name, # type: str + disk, # type: "_models.Disk" + **kwargs # type: Any + ): + # type: (...) -> "_models.Disk" + cls = kwargs.pop('cls', None) # type: ClsType["_models.Disk"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-30" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._create_or_update_initial.metadata['url'] # type: ignore + 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'), + 'diskName': self._serialize.url("disk_name", disk_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(disk, 'Disk') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('Disk', pipeline_response) + + if response.status_code == 202: + deserialized = self._deserialize('Disk', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/disks/{diskName}'} # type: ignore + + def begin_create_or_update( + self, + resource_group_name, # type: str + disk_name, # type: str + disk, # type: "_models.Disk" + **kwargs # type: Any + ): + # type: (...) -> LROPoller["_models.Disk"] + """Creates or updates a disk. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param disk_name: The name of the managed disk that is being created. The name can't be changed + after the disk is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The + maximum name length is 80 characters. + :type disk_name: str + :param disk: Disk object supplied in the body of the Put disk operation. + :type disk: ~azure.mgmt.compute.v2020_09_30.models.Disk + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either Disk or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.compute.v2020_09_30.models.Disk] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Disk"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._create_or_update_initial( + resource_group_name=resource_group_name, + disk_name=disk_name, + disk=disk, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('Disk', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + 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'), + 'diskName': self._serialize.url("disk_name", disk_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/disks/{diskName}'} # type: ignore + + def _update_initial( + self, + resource_group_name, # type: str + disk_name, # type: str + disk, # type: "_models.DiskUpdate" + **kwargs # type: Any + ): + # type: (...) -> "_models.Disk" + cls = kwargs.pop('cls', None) # type: ClsType["_models.Disk"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-30" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._update_initial.metadata['url'] # type: ignore + 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'), + 'diskName': self._serialize.url("disk_name", disk_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(disk, 'DiskUpdate') + body_content_kwargs['content'] = body_content + request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('Disk', pipeline_response) + + if response.status_code == 202: + deserialized = self._deserialize('Disk', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/disks/{diskName}'} # type: ignore + + def begin_update( + self, + resource_group_name, # type: str + disk_name, # type: str + disk, # type: "_models.DiskUpdate" + **kwargs # type: Any + ): + # type: (...) -> LROPoller["_models.Disk"] + """Updates (patches) a disk. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param disk_name: The name of the managed disk that is being created. The name can't be changed + after the disk is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The + maximum name length is 80 characters. + :type disk_name: str + :param disk: Disk object supplied in the body of the Patch disk operation. + :type disk: ~azure.mgmt.compute.v2020_09_30.models.DiskUpdate + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either Disk or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.compute.v2020_09_30.models.Disk] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Disk"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._update_initial( + resource_group_name=resource_group_name, + disk_name=disk_name, + disk=disk, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('Disk', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + 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'), + 'diskName': self._serialize.url("disk_name", disk_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/disks/{diskName}'} # type: ignore + + def get( + self, + resource_group_name, # type: str + disk_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.Disk" + """Gets information about a disk. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param disk_name: The name of the managed disk that is being created. The name can't be changed + after the disk is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The + maximum name length is 80 characters. + :type disk_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: Disk, or the result of cls(response) + :rtype: ~azure.mgmt.compute.v2020_09_30.models.Disk + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.Disk"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-30" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + 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'), + 'diskName': self._serialize.url("disk_name", disk_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('Disk', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/disks/{diskName}'} # type: ignore + + def _delete_initial( + self, + resource_group_name, # type: str + disk_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-30" + + # Construct URL + url = self._delete_initial.metadata['url'] # type: ignore + 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'), + 'diskName': self._serialize.url("disk_name", disk_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/disks/{diskName}'} # type: ignore + + def begin_delete( + self, + resource_group_name, # type: str + disk_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> LROPoller[None] + """Deletes a disk. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param disk_name: The name of the managed disk that is being created. The name can't be changed + after the disk is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The + maximum name length is 80 characters. + :type disk_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._delete_initial( + resource_group_name=resource_group_name, + disk_name=disk_name, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + 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'), + 'diskName': self._serialize.url("disk_name", disk_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/disks/{diskName}'} # type: ignore + + def list_by_resource_group( + self, + resource_group_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.DiskList"] + """Lists all the disks under a resource group. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either DiskList or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.compute.v2020_09_30.models.DiskList] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.DiskList"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-30" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_by_resource_group.metadata['url'] # type: ignore + 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'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('DiskList', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/disks'} # type: ignore + + def list( + self, + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.DiskList"] + """Lists all the disks under a subscription. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either DiskList or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.compute.v2020_09_30.models.DiskList] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.DiskList"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-30" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('DiskList', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Compute/disks'} # type: ignore + + def _grant_access_initial( + self, + resource_group_name, # type: str + disk_name, # type: str + grant_access_data, # type: "_models.GrantAccessData" + **kwargs # type: Any + ): + # type: (...) -> Optional["_models.AccessUri"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.AccessUri"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-30" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._grant_access_initial.metadata['url'] # type: ignore + 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'), + 'diskName': self._serialize.url("disk_name", disk_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(grant_access_data, 'GrantAccessData') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('AccessUri', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _grant_access_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/disks/{diskName}/beginGetAccess'} # type: ignore + + def begin_grant_access( + self, + resource_group_name, # type: str + disk_name, # type: str + grant_access_data, # type: "_models.GrantAccessData" + **kwargs # type: Any + ): + # type: (...) -> LROPoller["_models.AccessUri"] + """Grants access to a disk. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param disk_name: The name of the managed disk that is being created. The name can't be changed + after the disk is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The + maximum name length is 80 characters. + :type disk_name: str + :param grant_access_data: Access data object supplied in the body of the get disk access + operation. + :type grant_access_data: ~azure.mgmt.compute.v2020_09_30.models.GrantAccessData + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either AccessUri or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.compute.v2020_09_30.models.AccessUri] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AccessUri"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._grant_access_initial( + resource_group_name=resource_group_name, + disk_name=disk_name, + grant_access_data=grant_access_data, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('AccessUri', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + 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'), + 'diskName': self._serialize.url("disk_name", disk_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_grant_access.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/disks/{diskName}/beginGetAccess'} # type: ignore + + def _revoke_access_initial( + self, + resource_group_name, # type: str + disk_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-30" + + # Construct URL + url = self._revoke_access_initial.metadata['url'] # type: ignore + 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'), + 'diskName': self._serialize.url("disk_name", disk_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _revoke_access_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/disks/{diskName}/endGetAccess'} # type: ignore + + def begin_revoke_access( + self, + resource_group_name, # type: str + disk_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> LROPoller[None] + """Revokes access to a disk. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param disk_name: The name of the managed disk that is being created. The name can't be changed + after the disk is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The + maximum name length is 80 characters. + :type disk_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._revoke_access_initial( + resource_group_name=resource_group_name, + disk_name=disk_name, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + 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'), + 'diskName': self._serialize.url("disk_name", disk_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_revoke_access.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/disks/{diskName}/endGetAccess'} # type: ignore diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_09_30/operations/_snapshots_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_09_30/operations/_snapshots_operations.py new file mode 100644 index 000000000000..8a30efbbd67f --- /dev/null +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_09_30/operations/_snapshots_operations.py @@ -0,0 +1,862 @@ +# 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 typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.core.polling import LROPoller, NoPolling, PollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.arm_polling import ARMPolling + +from .. import models as _models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class SnapshotsOperations(object): + """SnapshotsOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.compute.v2020_09_30.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def _create_or_update_initial( + self, + resource_group_name, # type: str + snapshot_name, # type: str + snapshot, # type: "_models.Snapshot" + **kwargs # type: Any + ): + # type: (...) -> "_models.Snapshot" + cls = kwargs.pop('cls', None) # type: ClsType["_models.Snapshot"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-30" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._create_or_update_initial.metadata['url'] # type: ignore + 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'), + 'snapshotName': self._serialize.url("snapshot_name", snapshot_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(snapshot, 'Snapshot') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('Snapshot', pipeline_response) + + if response.status_code == 202: + deserialized = self._deserialize('Snapshot', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/snapshots/{snapshotName}'} # type: ignore + + def begin_create_or_update( + self, + resource_group_name, # type: str + snapshot_name, # type: str + snapshot, # type: "_models.Snapshot" + **kwargs # type: Any + ): + # type: (...) -> LROPoller["_models.Snapshot"] + """Creates or updates a snapshot. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param snapshot_name: The name of the snapshot that is being created. The name can't be changed + after the snapshot is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The + max name length is 80 characters. + :type snapshot_name: str + :param snapshot: Snapshot object supplied in the body of the Put disk operation. + :type snapshot: ~azure.mgmt.compute.v2020_09_30.models.Snapshot + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either Snapshot or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.compute.v2020_09_30.models.Snapshot] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Snapshot"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._create_or_update_initial( + resource_group_name=resource_group_name, + snapshot_name=snapshot_name, + snapshot=snapshot, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('Snapshot', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + 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'), + 'snapshotName': self._serialize.url("snapshot_name", snapshot_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/snapshots/{snapshotName}'} # type: ignore + + def _update_initial( + self, + resource_group_name, # type: str + snapshot_name, # type: str + snapshot, # type: "_models.SnapshotUpdate" + **kwargs # type: Any + ): + # type: (...) -> "_models.Snapshot" + cls = kwargs.pop('cls', None) # type: ClsType["_models.Snapshot"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-30" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._update_initial.metadata['url'] # type: ignore + 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'), + 'snapshotName': self._serialize.url("snapshot_name", snapshot_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(snapshot, 'SnapshotUpdate') + body_content_kwargs['content'] = body_content + request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('Snapshot', pipeline_response) + + if response.status_code == 202: + deserialized = self._deserialize('Snapshot', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/snapshots/{snapshotName}'} # type: ignore + + def begin_update( + self, + resource_group_name, # type: str + snapshot_name, # type: str + snapshot, # type: "_models.SnapshotUpdate" + **kwargs # type: Any + ): + # type: (...) -> LROPoller["_models.Snapshot"] + """Updates (patches) a snapshot. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param snapshot_name: The name of the snapshot that is being created. The name can't be changed + after the snapshot is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The + max name length is 80 characters. + :type snapshot_name: str + :param snapshot: Snapshot object supplied in the body of the Patch snapshot operation. + :type snapshot: ~azure.mgmt.compute.v2020_09_30.models.SnapshotUpdate + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either Snapshot or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.compute.v2020_09_30.models.Snapshot] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Snapshot"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._update_initial( + resource_group_name=resource_group_name, + snapshot_name=snapshot_name, + snapshot=snapshot, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('Snapshot', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + 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'), + 'snapshotName': self._serialize.url("snapshot_name", snapshot_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/snapshots/{snapshotName}'} # type: ignore + + def get( + self, + resource_group_name, # type: str + snapshot_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.Snapshot" + """Gets information about a snapshot. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param snapshot_name: The name of the snapshot that is being created. The name can't be changed + after the snapshot is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The + max name length is 80 characters. + :type snapshot_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: Snapshot, or the result of cls(response) + :rtype: ~azure.mgmt.compute.v2020_09_30.models.Snapshot + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.Snapshot"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-30" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + 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'), + 'snapshotName': self._serialize.url("snapshot_name", snapshot_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('Snapshot', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/snapshots/{snapshotName}'} # type: ignore + + def _delete_initial( + self, + resource_group_name, # type: str + snapshot_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-30" + + # Construct URL + url = self._delete_initial.metadata['url'] # type: ignore + 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'), + 'snapshotName': self._serialize.url("snapshot_name", snapshot_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/snapshots/{snapshotName}'} # type: ignore + + def begin_delete( + self, + resource_group_name, # type: str + snapshot_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> LROPoller[None] + """Deletes a snapshot. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param snapshot_name: The name of the snapshot that is being created. The name can't be changed + after the snapshot is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The + max name length is 80 characters. + :type snapshot_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._delete_initial( + resource_group_name=resource_group_name, + snapshot_name=snapshot_name, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + 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'), + 'snapshotName': self._serialize.url("snapshot_name", snapshot_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/snapshots/{snapshotName}'} # type: ignore + + def list_by_resource_group( + self, + resource_group_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.SnapshotList"] + """Lists snapshots under a resource group. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either SnapshotList or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.compute.v2020_09_30.models.SnapshotList] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SnapshotList"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-30" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_by_resource_group.metadata['url'] # type: ignore + 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'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('SnapshotList', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/snapshots'} # type: ignore + + def list( + self, + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.SnapshotList"] + """Lists snapshots under a subscription. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either SnapshotList or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.compute.v2020_09_30.models.SnapshotList] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SnapshotList"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-30" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('SnapshotList', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Compute/snapshots'} # type: ignore + + def _grant_access_initial( + self, + resource_group_name, # type: str + snapshot_name, # type: str + grant_access_data, # type: "_models.GrantAccessData" + **kwargs # type: Any + ): + # type: (...) -> Optional["_models.AccessUri"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.AccessUri"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-30" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._grant_access_initial.metadata['url'] # type: ignore + 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'), + 'snapshotName': self._serialize.url("snapshot_name", snapshot_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(grant_access_data, 'GrantAccessData') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('AccessUri', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _grant_access_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/snapshots/{snapshotName}/beginGetAccess'} # type: ignore + + def begin_grant_access( + self, + resource_group_name, # type: str + snapshot_name, # type: str + grant_access_data, # type: "_models.GrantAccessData" + **kwargs # type: Any + ): + # type: (...) -> LROPoller["_models.AccessUri"] + """Grants access to a snapshot. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param snapshot_name: The name of the snapshot that is being created. The name can't be changed + after the snapshot is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The + max name length is 80 characters. + :type snapshot_name: str + :param grant_access_data: Access data object supplied in the body of the get snapshot access + operation. + :type grant_access_data: ~azure.mgmt.compute.v2020_09_30.models.GrantAccessData + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either AccessUri or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.compute.v2020_09_30.models.AccessUri] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AccessUri"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._grant_access_initial( + resource_group_name=resource_group_name, + snapshot_name=snapshot_name, + grant_access_data=grant_access_data, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('AccessUri', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + 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'), + 'snapshotName': self._serialize.url("snapshot_name", snapshot_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_grant_access.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/snapshots/{snapshotName}/beginGetAccess'} # type: ignore + + def _revoke_access_initial( + self, + resource_group_name, # type: str + snapshot_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-09-30" + + # Construct URL + url = self._revoke_access_initial.metadata['url'] # type: ignore + 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'), + 'snapshotName': self._serialize.url("snapshot_name", snapshot_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _revoke_access_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/snapshots/{snapshotName}/endGetAccess'} # type: ignore + + def begin_revoke_access( + self, + resource_group_name, # type: str + snapshot_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> LROPoller[None] + """Revokes access to a snapshot. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param snapshot_name: The name of the snapshot that is being created. The name can't be changed + after the snapshot is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The + max name length is 80 characters. + :type snapshot_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._revoke_access_initial( + resource_group_name=resource_group_name, + snapshot_name=snapshot_name, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + 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'), + 'snapshotName': self._serialize.url("snapshot_name", snapshot_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_revoke_access.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/snapshots/{snapshotName}/endGetAccess'} # type: ignore